Template:Hex
This template shows the exact value of a number of type float.
The significand is given in hexadecimal format, which, apart from the sign, consists of a fixed "1.
", followed by 13 hexadecimal characters.
Denormal numbers are shown in normalized format, not in internal format, but without inherently zero digits.
No distinction is made between 0 and -0.
For numbers of type integer which are not exactly representable as float the integer is rounded to float. If an integer just below 2^n is rounded to 2^n the result is shown in the form 2*2^(n-1), thus giving the exponent the value it would have in an exact floating-point representation (which would require up to 10 bits more, hence up to three hexadecimal digits more).
See also Manual:Floating-point errors in expr parser function.
Examples
[edit]{{hex}}
β{{hex|a}}
βa
{{hex|0}}
β0
{{hex|-0}}
β0
{{hex|1/7}}
β1.2492492492492hex*2^-3
{{hex|-2/3}}
β-1.5555555555555hex*2^-1
{{hex|123}}
β1.ec00000000000hex*2^6
{{hex|.0123}}
β1.930be0ded288dhex*2^-7
{{hex|1+2^-52}}
β1.0000000000001hex*2^0
{{hex|1.0000000000000002}}
β1.0000000000001hex*2^0
{{hex|1+2e-16}}
β1.0000000000001hex*2^0
{{hex|-1e309}}
β-INF
{{hex|1e309}}
βINF
{{hex|1e308}}
β1.1ccf385ebc8a0hex*2^1023
{{hex|1e307}}
β1.c7b1f3cac7433hex*2^1019
{{hex|1e306}}
β1.6c8e5ca239029hex*2^1016
{{hex|1e305}}
β1.23a516e82d9bahex*2^1013
{{hex|1e304}}
β1.d2a1be4048f90hex*2^1009
{{hex|1e303}}
β1.754e31cd072dahex*2^1006
{{hex|1e302}}
β1.2aa4f4a405be2hex*2^1003
{{hex|1e301}}
β1.ddd4baa009303hex*2^999
{{hex|1e300}}
β1.7e43c8800759chex*2^996
{{hex|1e299}}
β1.31cfd3999f7b0hex*2^993
{{hex|1e298}}
β1.e94c85c298c4chex*2^989
{{hex|1e297}}
β1.87706b0213d0ahex*2^986
{{hex|1e296}}
β1.3926bc01a973bhex*2^983
{{hex|1e295}}
β1.f50ac6690f1f8hex*2^979
{{hex|1e294}}
β1.90d56b873f4c7hex*2^976
{{hex|1e293}}
β1.40aabc6c32a38hex*2^973
{{hex|1e292}}
β1.008896bcf54fahex*2^970
{{hex|1e-308}}
β1.cc359e067a348hex*2^-1024
{{hex|1e-309}}
β1.702ae4d1fb5ehex*2^-1027
{{hex|1e-310}}
β1.2688b70e62bhex*2^-1030
{{hex|1e-311}}
β1.d74124e3d1hex*2^-1034
{{hex|1e-312}}
β1.7900ea4fd8hex*2^-1037
{{hex|1e-313}}
β1.2d9a550cchex*2^-1040
{{hex|1e-314}}
β1.e2908814hex*2^-1044
{{hex|1e-315}}
β1.820d39ahex*2^-1047
{{hex|1e-316}}
β1.34d761hex*2^-1050
{{hex|1e-317}}
β1.ee257hex*2^-1054
{{hex|1e-318}}
β1.8b510hex*2^-1057
{{hex|1e-319}}
β1.3c40hex*2^-1060
{{hex|1e-320}}
β1.fa0hex*2^-1064
{{hex|1e-321}}
β1.94hex*2^-1067
{{hex|1e-322}}
β1.4hex*2^-1070
{{hex|1e-323}}
β1.0hex*2^-1073
{{hex|1e-323/2}}
β1.hex*2^-1074
{{hex|1e-323/3}}
β1.hex*2^-1074
{{hex|1e-323/4}}
β0
{{hex|.{{loop|323|0}}25}}
β1.hex*2^-1074
{{hex|.{{loop|323|0}}24}}
β0
{{hex|1000000e-324}}
β0
{{hex|1.71*2^-1021}}
β1.b5c28f5c28f5chex*2^-1021
{{hex|1.71*2^-1022}}
β1.b5c28f5c28f5chex*2^-1022
{{hex|1.71*2^-1023}}
β1.b5c28f5c28f5chex*2^-1023
{{hex|1.71*2^-1024}}
β1.b5c28f5c28f5chex*2^-1024
{{hex|1.71*2^-1025}}
β1.b5c28f5c28f60hex*2^-1025
{{hex|1.71*2^-1064}}
β1.b5chex*2^-1064
{{hex|1.71*2^-1065}}
β1.b60hex*2^-1065
{{hex|1.71*2^-1066}}
β1.b6hex*2^-1066
{{hex|1.71*2^-1067}}
β1.b6hex*2^-1067
{{hex|1.71*2^-1068}}
β1.b4hex*2^-1068
{{hex|1.71*2^-1069}}
β1.b8hex*2^-1069
{{hex|1.71*2^-1070}}
β1.bhex*2^-1070
{{hex|1.71*2^-1071}}
β1.chex*2^-1071
{{hex|1.71*2^-1072}}
β1.chex*2^-1072
{{hex|1.71*2^-1073}}
β1.8hex*2^-1073
{{hex|1.71*2^-1074}}
β1.0hex*2^-1073
{{hex|3*2^-1074}}
β1.8hex*2^-1073
{{hex|2*2^-1074}}
β1.0hex*2^-1073
{{hex|1*2^-1074}}
β1.hex*2^-1074
Numbers of type integer which are not exactly representable as float:
{{hex|trunc(2^62-512)+trunc511}}
β2hex*2^61