7-6
EPSOn
S5U1C17001C ManUal
(C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
7 liBrary
7.2.3 floating-point number Processing implementation Definition
The following processes are implementation-defined due to C language specifications. The package emulation
library handles them as described below.
floating-point value rounding method
In type conversion from integer type to floating-point type or from one floating-point type to another floating-
point type or in floating-point calculations, if the target value is halfway between two adjacent values
expressible by the intended format, whether the result is rounded to the larger value or smaller value is
implementation-defined.
This package is designed to round values to yield even numbers.
In other words, if the LSB of the value before rounding is 0, no rounding is performed. If the LSB is 1, the
value is rounded up by 1.
Conversion from floating-point type to integer type
In converting a floating-point number to an integral number, the fractional part will be truncated.
Following truncation, the action taken if the original value cannot be expressed in the intended format is
implementation-defined.
・
Conversion from single-/double-precision floating-point type to signed/unsigned long
If the original value is +NaN
→
0x0
if the intended format is signed or
0x80000000
if unsigned
If the original value is –NaN
→
0x0
If the original value is too large
→
Maximum value that can be expressed in the intended format
If the original value is too small
→
0x80000000
・
Conversion from single-/double-precision floating-point type to signed/unsigned long long
If the original value is +NaN
→
0x80000000 80000000
If the original value is –NaN
→
0x7fffffff 80000000
if the intended format is signed or
0x0
if
unsigned
If the original value is too large
→
0xffffffff ffffffff
If the original value is too small
→
0x1
if the intended format is signed or
0x0
if unsigned
Conversion from one floating-point type to another floating-point type
If the original value cannot be expressed in the intended format in the conversion from one floating-point type
to another floating-point type, the action taken is implementation-defined.
・
Conversion from double-precision floating-point type to single-precision floating-point type
If the original value is +NaN
→
The significand of the double-precision floating-point number is shifted
two bits to the left and the higher-order 32 bits obtained. If the lower-
order 32 bits of the truncated significand are not
0x0
, the LSB of the
32-bit significand is set to 1, and the logical sum of that value and
0x7f900000
is used (+NaN).
If the original value is –NaN
→
The significand of the double-precision floating-point number is shifted
two bits to the left and the higher-order 32 bits obtained. If the lower-
order 32 bits of the truncated significand are not
0x0
, the LSB of the
32-bit significand is set to 1, and the logical sum of that value and
0xff900000
is used (
−
NaN).
If the original value is too large
→
0x7f800000 (+
∞
)
If the original value is too small
→
0xff800000 (−
∞
)
If the original value is too close to 0 (larger than 0)
→
0x00000000 (+0)
If the original value is too close to 0 (less than 0)
→
0x80000000 (−0)
・
Conversion from single-precision floating-point type to double-precision floating-point type
If the original value is +NaN
→
The significand of the single-precision floating-point number is
shifted two bits to the right, and the logical sum of that value and
0x7ff80000 00000000
is used.
If the original value is
−
NaN
→
The significand of the single-precision floating-point number is
shifted two bits to the right, and the logical sum of that value and
0xfff80000 00000000
is used.
Summary of Contents for S5U1C17001C
Page 6: ......
Page 17: ...1 General S5U1C17001C Manual 1 General ...
Page 18: ......
Page 21: ...1 2 Install S5U1C17001C Manual 2 Installation ...
Page 22: ......
Page 29: ...3 SoftDev S5U1C17001C Manual 3 Software Development Procedures ...
Page 30: ......
Page 103: ...4 SrcFiles S5U1C17001C Manual 4 Source files ...
Page 104: ......
Page 121: ...5 IDE S5U1C17001C Manual 5 gnU17 iDE ...
Page 122: ......
Page 365: ...6 Compiler S5U1C17001C Manual 6 C Compiler ...
Page 366: ......
Page 385: ...7 Library S5U1C17001C Manual 7 library ...
Page 386: ......
Page 405: ...8 Assemblr S5U1C17001C Manual 8 assembler ...
Page 406: ......
Page 439: ...9 Linker S5U1C17001C Manual 9 linker ...
Page 440: ......
Page 449: ...10 Debugger S5U1C17001C Manual 10 Debugger ...
Page 450: ......
Page 626: ...11 Tools S5U1C17001C Manual 11 Other Tools ...
Page 627: ......
Page 696: ...S1C17 Family C Compiler Package Quick Reference Reference ...