• Home
Name Date Size #Lines LOC

..--

entry/12-May-2024-928855

screenshots/device/12-May-2024-

.gitignoreD12-May-2024121 88

README.mdD12-May-20241 KiB2412

README_zh.mdD12-May-20241.2 KiB3518

build-profile.json5D12-May-20241 KiB4341

hvigorfile.jsD12-May-2024174 21

package.jsonD12-May-2024304 1515

README.md

1# util Tool Function – RationalNumber
2
3### Introduction
4
5This sample shows how to use the **RationalNumber** function in the **util** class for rational number operations.
6
7### Usage
8
91. Touch **Compare rational numbers** to compare two rational numbers. The comparison result is displayed in the text box.
10
112. Touch **Get rational number value**. The integer or floating point value of the first rational number is displayed in the text box.
12
133. Touch **Get numerator and denominator**. The numerator and denominator of the rational number are displayed in the text box.
14
154. Touch **Check for zero** to check whether the rational number is **0**. The check result is displayed in the text box.
16
175. Touch **Check for NaN** to check whether the rational number is Not a Number (NaN). The check result is displayed in the text box.
18
196. Touch **Check for finite number** to check whether the rational number is a finite number. The check result is displayed in the text box.
20
21### Constraints
22
23This sample can only be run on standard-system devices.
24

README_zh.md

1# 有理数
2
3### 简介
4
5本示例展示了util工具类中的有理数运算的一些方法使用。实现效果如下:
6
7![](./screenshots/device/eTSRationalNumber.png)
8
9### 相关概念
10
11utill工具函数提供多种常用函数,如:实现字符串编解码、有理数运算、缓冲区管理、范围判断、Base64编解码、内置对象类型检查等。
12
13### 相关权限
14
15不涉及。
16
17### 使用与说明
18
191.点击按钮“**有理数比较**”,对两个有理数进行比较,比较结果会在文本框中显示。
20
212.点击按钮“**获取有理数的值**”,将在文本框中显示第一个有理数的整数或浮点型的值。
22
233.点击按钮“**获取有理数分子分母**”,在文本框中显示有理数的分子分母。
24
254.点击按钮“**检查是否为0**”,在文本框中显示判断有理数是否为0的结果。
26
275.点击按钮“**检查是否表示NaN**”,在文本框中显示判断有理数是否为非数字结果。
28
296.点击按钮“**检查是否为有限值**”,在文本框中显示有理数是否为有限值结果。
30
31### 约束与限制
32
331.本示例仅支持在标准系统上运行。
34
352.本示例需要使用DevEco Studio 3.0 Beta4 (Build Version: 3.0.0.992, built on July 14, 2022)才可编译运行。