Knowledge (XXG)

Arithmetic underflow

Source 📝

121:. The subnormal numbers (including zero) fill the underflow gap with values where the absolute distance between adjacent values is the same as for adjacent values just outside the underflow gap. This enables "gradual underflow", where a nearest subnormal value is used, just as a nearest normal value is used when possible. Even when using gradual underflow, the nearest value may be zero. 237:
on underflow, this may happen regardless of consideration for loss of precision. The default handling in IEEE 754 for underflow (as well as other exceptions) is to record as a floating point status that underflow has occurred. This is specified for the application-programming level, but often also
101:
is the smallest positive normal floating point value, is called the underflow gap. This is because the size of this interval is many orders of magnitude larger than the distance between adjacent normal floating point values just outside the gap. For instance, if the floating point datatype can
213:
is a function which converts the real value into the floating point representation. While the machine epsilon is not to be confused with the underflow level (assuming subnormal numbers), it is closely related. The machine epsilon is dependent on the number of bits which make up the
109:
In older designs, the underflow gap had just one usable value, zero. When an underflow occurred, the true result was replaced by zero (either directly by the hardware, or by system software handling the primary underflow condition). This replacement is called "flush to zero".
84:
condition whereby the result of subtraction would result in a value less than the minimum allowed for a given integer type, i.e. the ideal result was closer to negative infinity than the output type's representable value closest to negative infinity.
405: 218:, whereas the underflow level depends on the number of digits which make up the exponent field. In most floating point systems, the underflow level is smaller than the machine epsilon. 182: 226:
The occurrence of an underflow may set a ("sticky") status bit, raise an exception, at the hardware level generate an interrupt, or may cause some combination of these effects.
73:
of the floating point value. For example, if the exponent part can represent values from −128 to 127, then a result with a value less than −128 may cause underflow.
233:, the underflow condition is only signaled if there is also a loss of precision. Typically this is determined as the final result being inexact. However, if the user is 128:, typically characterized by the largest value whose sum with the value 1 will result in the answer with value 1 in that floating point scheme. This can be written as 211: 369: 484: 106:, the underflow gap is 2 times larger than the absolute distance between adjacent floating point values just outside the gap. 42:
where the result of a calculation is a number of more precise absolute value than the computer can actually represent in
506: 277: 267: 252: 58: 54: 47: 131: 297:
Coonen, Jerome T (1980). "An implementation guide to a proposed standard for floating-point arithmetic".
66: 387: 314: 124:
The absolute distance between adjacent floating point values just outside the gap is called the
480: 118: 57:
is smaller in magnitude (that is, closer to zero) than the smallest value representable as a
457: 306: 262: 234: 77: 39: 272: 247: 187: 125: 43: 20: 350: 19:"Underflow" redirects here. For the condition of attempting to read an empty buffer, see 500: 318: 332: 424: 388:"Integer underflow and buffer overflow processing MP4 metadata in libstagefright" 76:
For integers, the term "integer underflow" typically refers to a special kind of
215: 448:
Demmel, James (1984). "Underflow and the Reliability of Numerical Software".
310: 62: 257: 230: 114: 70: 461: 103: 333:"CWE - CWE-191: Integer Underflow (Wrap or Wraparound) (3.1)" 370:"Integer Overflow/Underflow and Floating Point Imprecision" 351:"Overflow And Underflow of Data Types in Java - DZone Java" 53:
Arithmetic underflow can occur when the true result of a
238:
interpreted as how to handle it at the hardware level.
479:(Second ed.). New York: McGraw-Hill. p. 20. 190: 134: 450:
SIAM Journal on Scientific and Statistical Computing
205: 176: 65:. Underflow can in part be regarded as negative 8: 406:"Avoiding Buffer Overflows and Underflows" 189: 133: 289: 93:The interval between − zero and 177:{\displaystyle fl(1+\epsilon )=fl(1)} 7: 61:floating point number in the target 14: 200: 197: 171: 165: 153: 141: 16:Computer programming condition 1: 368:Mir, Tabish (4 April 2017). 426:Numerical Computation Guide 523: 475:Heath, Michael T. (2002). 18: 423:Sun Microsystems (2005). 278:Normal number (computing) 268:Logarithmic number system 253:Floating-point arithmetic 55:floating point operation 32:floating point underflow 311:10.1109/mc.1980.1653344 48:central processing unit 207: 178: 38:) is a condition in a 222:Handling of underflow 208: 179: 477:Scientific Computing 206:{\displaystyle fl()} 188: 132: 113:The 1984 edition of 28:arithmetic underflow 507:Computer arithmetic 410:developer.apple.com 203: 174: 82:integer wraparound 119:subnormal numbers 514: 491: 490: 472: 466: 465: 445: 439: 438: 436: 434: 420: 414: 413: 402: 396: 395: 384: 378: 377: 365: 359: 358: 347: 341: 340: 329: 323: 322: 294: 263:Integer overflow 229:As specified in 212: 210: 209: 204: 183: 181: 180: 175: 78:integer overflow 40:computer program 522: 521: 517: 516: 515: 513: 512: 511: 497: 496: 495: 494: 487: 474: 473: 469: 462:10.1137/0905062 447: 446: 442: 432: 430: 422: 421: 417: 404: 403: 399: 386: 385: 381: 367: 366: 362: 349: 348: 344: 331: 330: 326: 296: 295: 291: 286: 273:Machine epsilon 248:Denormal number 244: 224: 186: 185: 130: 129: 126:machine epsilon 91: 24: 21:Buffer underrun 17: 12: 11: 5: 520: 518: 510: 509: 499: 498: 493: 492: 485: 467: 456:(4): 887–919. 440: 415: 397: 379: 360: 342: 324: 288: 287: 285: 282: 281: 280: 275: 270: 265: 260: 255: 250: 243: 240: 223: 220: 202: 199: 196: 193: 173: 170: 167: 164: 161: 158: 155: 152: 149: 146: 143: 140: 137: 90: 87: 15: 13: 10: 9: 6: 4: 3: 2: 519: 508: 505: 504: 502: 488: 486:0-07-239910-4 482: 478: 471: 468: 463: 459: 455: 451: 444: 441: 428: 427: 419: 416: 411: 407: 401: 398: 393: 389: 383: 380: 375: 371: 364: 361: 356: 352: 346: 343: 338: 337:cwe.mitre.org 334: 328: 325: 320: 316: 312: 308: 304: 300: 293: 290: 283: 279: 276: 274: 271: 269: 266: 264: 261: 259: 256: 254: 251: 249: 246: 245: 241: 239: 236: 232: 227: 221: 219: 217: 194: 191: 168: 162: 159: 156: 150: 147: 144: 138: 135: 127: 122: 120: 116: 111: 107: 105: 102:represent 20 100: 96: 89:Underflow gap 88: 86: 83: 79: 74: 72: 68: 64: 60: 56: 51: 49: 45: 41: 37: 33: 29: 22: 476: 470: 453: 449: 443: 431:. Retrieved 425: 418: 409: 400: 391: 382: 373: 363: 354: 345: 336: 327: 305:(1): 68–79. 302: 298: 292: 228: 225: 123: 112: 108: 98: 94: 92: 81: 75: 52: 35: 31: 27: 25: 216:significand 117:introduced 374:medium.com 284:References 34:, or just 355:dzone.com 319:206445847 151:ϵ 36:underflow 26:The term 501:Category 433:21 April 429:. Oracle 299:Computer 258:IEEE 754 242:See also 235:trapping 231:IEEE 754 184:, where 115:IEEE 754 97:, where 71:exponent 67:overflow 63:datatype 392:Mozilla 69:of the 50:(CPU). 46:on its 483:  317:  59:normal 44:memory 30:(also 315:S2CID 99:fminN 95:fminN 481:ISBN 435:2018 104:bits 458:doi 307:doi 80:or 503:: 452:. 408:. 390:. 372:. 353:. 335:. 313:. 303:13 301:. 489:. 464:. 460:: 454:5 437:. 412:. 394:. 376:. 357:. 339:. 321:. 309:: 201:) 198:( 195:l 192:f 172:) 169:1 166:( 163:l 160:f 157:= 154:) 148:+ 145:1 142:( 139:l 136:f 23:.

Index

Buffer underrun
computer program
memory
central processing unit
floating point operation
normal
datatype
overflow
exponent
integer overflow
bits
IEEE 754
subnormal numbers
machine epsilon
significand
IEEE 754
trapping
Denormal number
Floating-point arithmetic
IEEE 754
Integer overflow
Logarithmic number system
Machine epsilon
Normal number (computing)
doi
10.1109/mc.1980.1653344
S2CID
206445847
"CWE - CWE-191: Integer Underflow (Wrap or Wraparound) (3.1)"
"Overflow And Underflow of Data Types in Java - DZone Java"

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.