Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/blob/main/seed/ng/front/float-bounds.txt # omega-mv Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance. Brought by drakestapleton Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / seed / ng / front / float-bounds.txt` 876 lines ยท 10754 bytes Raw Blame History 1 WolframLanguageEvaluator queries (dimensionless exact integer bounds and exact scientific notation): 2 spec={{"uchar",8,False},{"ushort",16,False},{"uint",32,False},{"ulong",64,False},{"byte",8,True},{"short",16,True},{"int",32,True},{"long",64,True}}; rows=Flatten[Table[With[{w=s[[2]],sg=s[[3]],p=If[f=="f32",23,52]},With[{lo=If[sg,-2^(w-1),0],hi=If[sg,2^(w-1)-1,2^w-1]},{{s[[1]],f,"below",If[sg,lo-Max[1,2^(w-1-p)],-1]},{s[[1]],f,"minimum",lo},{s[[1]],f,"maximum",hi},{s[[1]],f,"above",If[sg,2^(w-1),2^w]}}]],{s,spec},{f,{"f32","f64"}}],2]; ExportString[Map[Map[If[IntegerQ[#],ToString[#,InputForm],#]&,#]&,rows],"RawJSON"] 3 4 Result: 5 [ 6 [ 7 "uchar", 8 "f32", 9 "below", 10 "-1" 11 ], 12 [ 13 "uchar", 14 "f32", 15 "minimum", 16 "0" 17 ], 18 [ 19 "uchar", 20 "f32", 21 "maximum", 22 "255" 23 ], 24 [ 25 "uchar", 26 "f32", 27 "above", 28 "256" 29 ], 30 [ 31 "uchar", 32 "f64", 33 "below", 34 "-1" 35 ], 36 [ 37 "uchar", 38 "f64", 39 "minimum", 40 "0" 41 ], 42 [ 43 "uchar", 44 "f64", 45 "maximum", 46 "255" 47 ], 48 [ 49 "uchar", 50 "f64", 51 "above", 52 "256" 53 ], 54 [ 55 "ushort", 56 "f32", 57 "below", 58 "-1" 59 ], 60 [ 61 "ushort", 62 "f32", 63 "minimum", 64 "0" 65 ], 66 [ 67 "ushort", 68 "f32", 69 "maximum", 70 "65535" 71 ], 72 [ 73 "ushort", 74 "f32", 75 "above", 76 "65536" 77 ], 78 [ 79 "ushort", 80 "f64", 81 "below", 82 "-1" 83 ], 84 [ 85 "ushort", 86 "f64", 87 "minimum", 88 "0" 89 ], 90 [ 91 "ushort", 92 "f64", 93 "maximum", 94 "65535" 95 ], 96 [ 97 "ushort", 98 "f64", 99 "above", 100 "65536" 101 ], 102 [ 103 "uint", 104 "f32", 105 "below", 106 "-1" 107 ], 108 [ 109 "uint", 110 "f32", 111 "minimum", 112 "0" 113 ], 114 [ 115 "uint", 116 "f32", 117 "maximum", 118 "`4294967295`" 119 ], 120 [ 121 "uint", 122 "f32", 123 "above", 124 "`4294967296`" 125 ], 126 [ 127 "uint", 128 "f64", 129 "below", 130 "-1" 131 ], 132 [ 133 "uint", 134 "f64", 135 "minimum", 136 "0" 137 ], 138 [ 139 "uint", 140 "f64", 141 "maximum", 142 "`4294967295`" 143 ], 144 [ 145 "uint", 146 "f64", 147 "above", 148 "`4294967296`" 149 ], 150 [ 151 "ulong", 152 "f32", 153 "below", 154 "-1" 155 ], 156 [ 157 "ulong", 158 "f32", 159 "minimum", 160 "0" 161 ], 162 [ 163 "ulong", 164 "f32", 165 "maximum", 166 "`18446744073709551615`" 167 ], 168 [ 169 "ulong", 170 "f32", 171 "above", 172 "`18446744073709551616`" 173 ], 174 [ 175 "ulong", 176 "f64", 177 "below", 178 "-1" 179 ], 180 [ 181 "ulong", 182 "f64", 183 "minimum", 184 "0" 185 ], 186 [ 187 "ulong", 188 "f64", 189 "maximum", 190 "`18446744073709551615`" 191 ], 192 [ 193 "ulong", 194 "f64", 195 "above", 196 "`18446744073709551616`" 197 ], 198 [ 199 "byte", 200 "f32", 201 "below", 202 "-129" 203 ], 204 [ 205 "byte", 206 "f32", 207 "minimum", 208 "-128" 209 ], 210 [ 211 "byte", 212 "f32", 213 "maximum", 214 "127" 215 ], 216 [ 217 "byte", 218 "f32", 219 "above", 220 "128" 221 ], 222 [ 223 "byte", 224 "f64", 225 "below", 226 "-129" 227 ], 228 [ 229 "byte", 230 "f64", 231 "minimum", 232 "-128" 233 ], 234 [ 235 "byte", 236 "f64", 237 "maximum", 238 "127" 239 ], 240 [ 241 "byte", 242 "f64", 243 "above", 244 "128" 245 ], 246 [ 247 "short", 248 "f32", 249 "below", 250 "-32769" 251 ], 252 [ 253 "short", 254 "f32", 255 "minimum", 256 "-32768" 257 ], 258 [ 259 "short", 260 "f32", 261 "maximum", 262 "32767" 263 ], 264 [ 265 "short", 266 "f32", 267 "above", 268 "32768" 269 ], 270 [ 271 "short", 272 "f64", 273 "below", 274 "-32769" 275 ], 276 [ 277 "short", 278 "f64", 279 "minimum", 280 "-32768" 281 ], 282 [ 283 "short", 284 "f64", 285 "maximum", 286 "32767" 287 ], 288 [ 289 "short", 290 "f64", 291 "above", 292 "32768" 293 ], 294 [ 295 "int", 296 "f32", 297 "below", 298 "-`2147483904`" 299 ], 300 [ 301 "int", 302 "f32", 303 "minimum", 304 "-`2147483648`" 305 ], 306 [ 307 "int", 308 "f32", 309 "maximum", 310 "`2147483647`" 311 ], 312 [ 313 "int", 314 "f32", 315 "above", 316 "`2147483648`" 317 ], 318 [ 319 "int", 320 "f64", 321 "below", 322 "-`2147483649`" 323 ], 324 [ 325 "int", 326 "f64", 327 "minimum", 328 "-`2147483648`" 329 ], 330 [ 331 "int", 332 "f64", 333 "maximum", 334 "`2147483647`" 335 ], 336 [ 337 "int", 338 "f64", 339 "above", 340 "`2147483648`" 341 ], 342 [ 343 "long", 344 "f32", 345 "below", 346 "-`9223373136366403584`" 347 ], 348 [ 349 "long", 350 "f32", 351 "minimum", 352 "-`9223372036854775808`" 353 ], 354 [ 355 "long", 356 "f32", 357 "maximum", 358 "`9223372036854775807`" 359 ], 360 [ 361 "long", 362 "f32", 363 "above", 364 "`9223372036854775808`" 365 ], 366 [ 367 "long", 368 "f64", 369 "below", 370 "-`9223372036854777856`" 371 ], 372 [ 373 "long", 374 "f64", 375 "minimum", 376 "-`9223372036854775808`" 377 ], 378 [ 379 "long", 380 "f64", 381 "maximum", 382 "`9223372036854775807`" 383 ], 384 [ 385 "long", 386 "f64", 387 "above", 388 "`9223372036854775808`" 389 ] 390 ] 391 392 Scientific notation query: 393 spec={{"uchar",8,False},{"ushort",16,False},{"uint",32,False},{"ulong",64,False},{"byte",8,True},{"short",16,True},{"int",32,True},{"long",64,True}}; rows=Flatten[Table[With[{w=s[[2]],sg=s[[3]],p=If[f=="f32",23,52]},With[{lo=If[sg,-2^(w-1),0],hi=If[sg,2^(w-1)-1,2^w-1]},{{s[[1]],f,"below",If[sg,lo-Max[1,2^(w-1-p)],-1]},{s[[1]],f,"minimum",lo},{s[[1]],f,"maximum",hi},{s[[1]],f,"above",If[sg,2^(w-1),2^w]}}]],{s,spec},{f,{"f32","f64"}}],2]; sci[n_Integer]:=Module[{d=ToString[Abs[n]],s=If[n<0,"-",""]},s<>If[StringLength[d]==1,d<>".0",StringTake[d,1]<>"."<>StringDrop[d,1]<>"e"<>ToString[StringLength[d]-1]]]; ExportString[Map[Append[Take[#,3],sci[Last[#]]]&,rows],"RawJSON"] 394 395 Result: 396 [ 397 [ 398 "uchar", 399 "f32", 400 "below", 401 "-1.0" 402 ], 403 [ 404 "uchar", 405 "f32", 406 "minimum", 407 "0.0" 408 ], 409 [ 410 "uchar", 411 "f32", 412 "maximum", 413 "2.55e2" 414 ], 415 [ 416 "uchar", 417 "f32", 418 "above", 419 "2.56e2" 420 ], 421 [ 422 "uchar", 423 "f64", 424 "below", 425 "-1.0" 426 ], 427 [ 428 "uchar", 429 "f64", 430 "minimum", 431 "0.0" 432 ], 433 [ 434 "uchar", 435 "f64", 436 "maximum", 437 "2.55e2" 438 ], 439 [ 440 "uchar", 441 "f64", 442 "above", 443 "2.56e2" 444 ], 445 [ 446 "ushort", 447 "f32", 448 "below", 449 "-1.0" 450 ], 451 [ 452 "ushort", 453 "f32", 454 "minimum", 455 "0.0" 456 ], 457 [ 458 "ushort", 459 "f32", 460 "maximum", 461 "6.5535e4" 462 ], 463 [ 464 "ushort", 465 "f32", 466 "above", 467 "6.5536e4" 468 ], 469 [ 470 "ushort", 471 "f64", 472 "below", 473 "-1.0" 474 ], 475 [ 476 "ushort", 477 "f64", 478 "minimum", 479 "0.0" 480 ], 481 [ 482 "ushort", 483 "f64", 484 "maximum", 485 "6.5535e4" 486 ], 487 [ 488 "ushort", 489 "f64", 490 "above", 491 "6.5536e4" 492 ], 493 [ 494 "uint", 495 "f32", 496 "below", 497 "-1.0" 498 ], 499 [ 500 "uint", 501 "f32", 502 "minimum", 503 "0.0" 504 ], 505 [ 506 "uint", 507 "f32", 508 "maximum", 509 "4.`294967295e9`" 510 ], 511 [ 512 "uint", 513 "f32", 514 "above", 515 "4.`294967296e9`" 516 ], 517 [ 518 "uint", 519 "f64", 520 "below", 521 "-1.0" 522 ], 523 [ 524 "uint", 525 "f64", 526 "minimum", 527 "0.0" 528 ], 529 [ 530 "uint", 531 "f64", 532 "maximum", 533 "4.`294967295e9`" 534 ], 535 [ 536 "uint", 537 "f64", 538 "above", 539 "4.`294967296e9`" 540 ], 541 [ 542 "ulong", 543 "f32", 544 "below", 545 "-1.0" 546 ], 547 [ 548 "ulong", 549 "f32", 550 "minimum", 551 "0.0" 552 ], 553 [ 554 "ulong", 555 "f32", 556 "maximum", 557 "1.`8446744073709551615e19`" 558 ], 559 [ 560 "ulong", 561 "f32", 562 "above", 563 "1.`8446744073709551616e19`" 564 ], 565 [ 566 "ulong", 567 "f64", 568 "below", 569 "-1.0" 570 ], 571 [ 572 "ulong", 573 "f64", 574 "minimum", 575 "0.0" 576 ], 577 [ 578 "ulong", 579 "f64", 580 "maximum", 581 "1.`8446744073709551615e19`" 582 ], 583 [ 584 "ulong", 585 "f64", 586 "above", 587 "1.`8446744073709551616e19`" 588 ], 589 [ 590 "byte", 591 "f32", 592 "below", 593 "-1.29e2" 594 ], 595 [ 596 "byte", 597 "f32", 598 "minimum", 599 "-1.28e2" 600 ], 601 [ 602 "byte", 603 "f32", 604 "maximum", 605 "1.27e2" 606 ], 607 [ 608 "byte", 609 "f32", 610 "above", 611 "1.28e2" 612 ], 613 [ 614 "byte", 615 "f64", 616 "below", 617 "-1.29e2" 618 ], 619 [ 620 "byte", 621 "f64", 622 "minimum", 623 "-1.28e2" 624 ], 625 [ 626 "byte", 627 "f64", 628 "maximum", 629 "1.27e2" 630 ], 631 [ 632 "byte", 633 "f64", 634 "above", 635 "1.28e2" 636 ], 637 [ 638 "short", 639 "f32", 640 "below", 641 "-3.2769e4" 642 ], 643 [ 644 "short", 645 "f32", 646 "minimum", 647 "-3.2768e4" 648 ], 649 [ 650 "short", 651 "f32", 652 "maximum", 653 "3.2767e4" 654 ], 655 [ 656 "short", 657 "f32", 658 "above", 659 "3.2768e4" 660 ], 661 [ 662 "short", 663 "f64", 664 "below", 665 "-3.2769e4" 666 ], 667 [ 668 "short", 669 "f64", 670 "minimum", 671 "-3.2768e4" 672 ], 673 [ 674 "short", 675 "f64", 676 "maximum", 677 "3.2767e4" 678 ], 679 [ 680 "short", 681 "f64", 682 "above", 683 "3.2768e4" 684 ], 685 [ 686 "int", 687 "f32", 688 "below", 689 "-2.`147483904e9`" 690 ], 691 [ 692 "int", 693 "f32", 694 "minimum", 695 "-2.`147483648e9`" 696 ], 697 [ 698 "int", 699 "f32", 700 "maximum", 701 "2.`147483647e9`" 702 ], 703 [ 704 "int", 705 "f32", 706 "above", 707 "2.`147483648e9`" 708 ], 709 [ 710 "int", 711 "f64", 712 "below", 713 "-2.`147483649e9`" 714 ], 715 [ 716 "int", 717 "f64", 718 "minimum", 719 "-2.`147483648e9`" 720 ], 721 [ 722 "int", 723 "f64", 724 "maximum", 725 "2.`147483647e9`" 726 ], 727 [ 728 "int", 729 "f64", 730 "above", 731 "2.`147483648e9`" 732 ], 733 [ 734 "long", 735 "f32", 736 "below", 737 "-9.`223373136366403584e18`" 738 ], 739 [ 740 "long", 741 "f32", 742 "minimum", 743 "-9.`223372036854775808e18`" 744 ], 745 [ 746 "long", 747 "f32", 748 "maximum", 749 "9.`223372036854775807e18`" 750 ], 751 [ 752 "long", 753 "f32", 754 "above", 755 "9.`223372036854775808e18`" 756 ], 757 [ 758 "long", 759 "f64", 760 "below", 761 "-9.`223372036854777856e18`" 762 ], 763 [ 764 "long", 765 "f64", 766 "minimum", 767 "-9.`223372036854775808e18`" 768 ], 769 [ 770 "long", 771 "f64", 772 "maximum", 773 "9.`223372036854775807e18`" 774 ], 775 [ 776 "long", 777 "f64", 778 "above", 779 "9.`223372036854775808e18`" 780 ] 781 ] 782 783 MODELED: exact input values only. Compiler and IR behavior is measured separately. 784 The seeded fparse accumulator limits the significant mantissa to 2^63-1 (omc.om 1970-2004), including scientific notation. Large 64-bit edge inputs therefore use exact power-of-two products and offsets, not an out-of-range mantissa. No edge case was removed. 785 786 787 Exact construction query: 788 spec={{"uchar",8,False},{"ushort",16,False},{"uint",32,False},{"ulong",64,False},{"byte",8,True},{"short",16,True},{"int",32,True},{"long",64,True}}; rows=Flatten[Table[With[{w=s[[2]],sg=s[[3]],p=If[f=="f32",23,52]},With[{lo=If[sg,-2^(w-1),0],hi=If[sg,2^(w-1)-1,2^w-1]},{{s[[1]],f,"below",If[sg,lo-Max[1,2^(w-1-p)],-1]},{s[[1]],f,"minimum",lo},{s[[1]],f,"maximum",hi},{s[[1]],f,"above",If[sg,2^(w-1),2^w]}}]],{s,spec},{f,{"f32","f64"}}],2]; sel=Select[rows,#[[1]]=="long"||(#[[1]]=="ulong"&&MemberQ[{"maximum","above"},#[[3]]])&]; mk[r_]:=Module[{t=r[[1]],f=r[[2]],k=r[[3]],p,u,v,e},p=If[t=="long",2^31*2^32,2^32*2^32];u=If[f=="f32",2^40,2^11];v=If[t=="ulong",If[k=="maximum",p-1,p],Switch[k,"below",-p-u,"minimum",-p,"maximum",p-1,"above",p]];e=If[t=="long","mul `2147483648`.0"<>f<>" `4294967296`.0"<>f,"mul `4294967296`.0"<>f<>" `4294967296`.0"<>f];e=If[t=="ulong",If[k=="maximum","sub "<>e<>" 1.0"<>f,e],Switch[k,"below","sub neg "<>e<>" "<>ToString[u]<>".0"<>f,"minimum","neg "<>e,"maximum","sub "<>e<>" 1.0"<>f,"above",e]];{t,f,k,e,v==r[[4]]}];ExportString[mk/@sel,"RawJSON"] 789 790 Result (last field verifies the integer construction equals the original exact bound): 791 [ 792 [ 793 "ulong", 794 "f32", 795 "maximum", 796 "sub mul `4294967296`.0f32 `4294967296`.0f32 1.0f32", 797 true 798 ], 799 [ 800 "ulong", 801 "f32", 802 "above", 803 "mul `4294967296`.0f32 `4294967296`.0f32", 804 true 805 ], 806 [ 807 "ulong", 808 "f64", 809 "maximum", 810 "sub mul `4294967296`.0f64 `4294967296`.0f64 1.0f64", 811 true 812 ], 813 [ 814 "ulong", 815 "f64", 816 "above", 817 "mul `4294967296`.0f64 `4294967296`.0f64", 818 true 819 ], 820 [ 821 "long", 822 "f32", 823 "below", 824 "sub neg mul `2147483648`.0f32 `4294967296`.0f32 `1099511627776`.0f32", 825 true 826 ], 827 [ 828 "long", 829 "f32", 830 "minimum", 831 "neg mul `2147483648`.0f32 `4294967296`.0f32", 832 true 833 ], 834 [ 835 "long", 836 "f32", 837 "maximum", 838 "sub mul `2147483648`.0f32 `4294967296`.0f32 1.0f32", 839 true 840 ], 841 [ 842 "long", 843 "f32", 844 "above", 845 "mul `2147483648`.0f32 `4294967296`.0f32", 846 true 847 ], 848 [ 849 "long", 850 "f64", 851 "below", 852 "sub neg mul `2147483648`.0f64 `4294967296`.0f64 2048.0f64", 853 true 854 ], 855 [ 856 "long", 857 "f64", 858 "minimum", 859 "neg mul `2147483648`.0f64 `4294967296`.0f64", 860 true 861 ], 862 [ 863 "long", 864 "f64", 865 "maximum", 866 "sub mul `2147483648`.0f64 `4294967296`.0f64 1.0f64", 867 true 868 ], 869 [ 870 "long", 871 "f64", 872 "above", 873 "mul `2147483648`.0f64 `4294967296`.0f64", 874 true 875 ] 876 ]