Example of the project nuts.Demo.Float128s for Lazarus

Float128 constants and string representations.

//////////////////////////////////////////////////////////////////////////////// ======================== Strings (NUTS constants) ======================== ------------------- Compiler directives ------------------- NUTS_DEBUG : defined NUTS_THREAD_SAFE : not defined NUTS_ASM_CODE : not defined ------- Context ------- Masks = [feInexact,feUnderflow] Flags = [] Rounding mode = rmTiesToEven ---------------------------- Float128s -> Decimal strings ---------------------------- F128_ZERO = 0.0 F128_MIN_SUBNORMAL = 6.47517511943802511092443895822764655e-4966 F128_MAX_SUBNORMAL = 3.36210314311209350626267781732175196e-4932 F128_MIN_NORMAL = 3.3621031431120935062626778173217526e-4932 F128_MAX_NORMAL = 1.18973149535723176508575932662800702e+4932 F128_INFINITY = Infinity F128_EMPTY_NAN = NaN --------------------------- Float128s -> Binary strings --------------------------- F128_ZERO = %0.0 F128_MIN_SUBNORMAL = %0.0000000000000000000000..0000000000000000000001p-16382 F128_MAX_SUBNORMAL = %0.1111111111111111111111..1111111111111111111111p-16382 F128_MIN_NORMAL = %1.0p-16382 F128_MAX_NORMAL = %1.1111111111111111111111..1111111111111111111111p+16383 F128_INFINITY = Infinity F128_EMPTY_NAN = NaN --------------------------------------------------- Float128s -> Hexadecimal strings (Pascal radix tag) --------------------------------------------------- F128_ZERO = $0.0 F128_MIN_SUBNORMAL = $0.0000000000000000000000000001p-16382 F128_MAX_SUBNORMAL = $0.FFFFFFFFFFFFFFFFFFFFFFFFFFFFp-16382 F128_MIN_NORMAL = $1.0p-16382 F128_MAX_NORMAL = $1.FFFFFFFFFFFFFFFFFFFFFFFFFFFFp+16383 F128_INFINITY = Infinity F128_EMPTY_NAN = NaN ----------------------------------------------------- Float128s -> Hexadecimal strings (standard radix tag) ----------------------------------------------------- F128_ZERO = 0x0.0p+0 F128_MIN_SUBNORMAL = 0x0.0000000000000000000000000001p-16382 F128_MAX_SUBNORMAL = 0x0.FFFFFFFFFFFFFFFFFFFFFFFFFFFFp-16382 F128_MIN_NORMAL = 0x1.0p-16382 F128_MAX_NORMAL = 0x1.FFFFFFFFFFFFFFFFFFFFFFFFFFFFp+16383 F128_INFINITY = Infinity F128_EMPTY_NAN = NaN ------------------------------------------------------------- Float128s -> Raw hexadecimal strings (for debugging purposes) ------------------------------------------------------------- F128_ZERO = +:0000:000000000000:0000000000000000:Zero F128_MIN_SUBNORMAL = +:0000:000000000000:0000000000000001:Subnormal F128_MAX_SUBNORMAL = +:0000:FFFFFFFFFFFF:FFFFFFFFFFFFFFFF:Subnormal F128_MIN_NORMAL = +:0001:000000000000:0000000000000000:Normal F128_MAX_NORMAL = +:7FFE:FFFFFFFFFFFF:FFFFFFFFFFFFFFFF:Normal F128_INFINITY = +:7FFF:000000000000:0000000000000000:Infinity F128_EMPTY_NAN = +:7FFF:800000000000:0000000000000000:NaN --------------------------------------------- Float128s (math constants) -> Decimal strings --------------------------------------------- Cbrt(2) = 1.25992104989487316476721060727822834 Euler = 2.71828182845904523536028747135266231 Euler gamma = 5.77215664901532860606512090082402471e-1 Ln(10) = 2.30258509299404568401799145468436418 Ln(2) = 6.93147180559945309417232121458176575e-1 Pi = 3.1415926535897932384626433832795028 Sqrt(2) = 1.41421356237309504880168872420969798 Sqrt(3) = 1.73205080756887729352744634150587232 ------------------------------------------------- Float128s (math constants) -> Hexadecimal strings ------------------------------------------------- Cbrt(2) = $1.428A2F98D728AE223DDAB715BE25 Euler = $1.5BF0A8B1457695355FB8AC404E7Ap+1 Euler gamma = $1.2788CFC6FB618F49A37C7F0202A6p-1 Ln(10) = $1.26BB1BBB5551582DD4ADAC5705A6p+1 Ln(2) = $1.62E42FEFA39EF35793C7673007E6p-1 Pi = $1.921FB54442D18469898CC51701B8p+1 Sqrt(2) = $1.6A09E667F3BCC908B2FB1366EA95 Sqrt(3) = $1.BB67AE8584CAA73B25742D7078B8 ////////////////////////////////////////////////////////////////////////////////