Unified · Split
| @@ -198,7 +198,7 @@ unknown_opt: · 197 unmodified lines | ||
| 198 | 198 | } else if (po->flags & OPT_INT64) { |
| 199 | 199 | *po->u.int64_arg = parse_number_or_die(opt, arg, OPT_INT64, INT64_MIN, INT64_MAX); |
| 200 | 200 | } else if (po->flags & OPT_FLOAT) { |
| 201 | − *po->u.float_arg = parse_number_or_die(opt, arg, OPT_FLOAT, -1.0/0.0, 1.0/0.0); | |
| 201 | + *po->u.float_arg = parse_number_or_die(opt, arg, OPT_FLOAT, -INFINITY, INFINITY); | |
| 202 | 202 | } else if (po->flags & OPT_FUNC2) { |
| 203 | 203 | if (po->u.func2_arg(opt, arg) < 0) { |
| 204 | 204 | fprintf(stderr, "%s: failed to set value '%s' for option '%s'\n", argv[0], arg, opt); |
| @@ -31,13 +31,13 @@ · 30 unmodified lines | ||
| 31 | 31 | |
| 32 | 32 | double av_int2dbl(int64_t v){ |
| 33 | 33 | if(v+v > 0xFFEULL<<52) |
| 34 | − return 0.0/0.0; | |
| 34 | + return NAN; | |
| 35 | 35 | return ldexp(((v&((1LL<<52)-1)) + (1LL<<52)) * (v>>63|1), (v>>52&0x7FF)-1075); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | float av_int2flt(int32_t v){ |
| 39 | 39 | if(v+v > 0xFF000000U) |
| 40 | − return 0.0/0.0; | |
| 40 | + return NAN; | |
| 41 | 41 | return ldexp(((v&0x7FFFFF) + (1<<23)) * (v>>31|1), (v>>23&0xFF)-150); |
| 42 | 42 | } |
| 43 | 43 | |
| @@ -49,7 +49,7 @@ double av_ext2dbl(const AVExtFloat ext){ · 5 unmodified lines | ||
| 49 | 49 | m = (m<<8) + ext.mantissa[i]; |
| 50 | 50 | e = (((int)ext.exponent[0]&0x7f)<<8) | ext.exponent[1]; |
| 51 | 51 | if (e == 0x7fff && m) |
| 52 | − return 0.0/0.0; | |
| 52 | + return NAN; | |
| 53 | 53 | e -= 16383 + 63; /* In IEEE 80 bits, the whole (i.e. 1.xxxx) |
| 54 | 54 | * mantissa bit is written as opposed to the |
| 55 | 55 | * single and double precision formats. */ |
| @@ -88,7 +88,7 @@ AVExtFloat av_dbl2ext(double d){ · 32 unmodified lines | ||
| 88 | 88 | ext.mantissa[i] = m>>(56-(i<<3)); |
| 89 | 89 | } else if (f != 0.0) { |
| 90 | 90 | ext.exponent[0] = 0x7f; ext.exponent[1] = 0xff; |
| 91 | − if (f != 1/0.0) | |
| 91 | + if (f != INFINITY) | |
| 92 | 92 | ext.mantissa[0] = ~0; |
| 93 | 93 | } |
| 94 | 94 | if (d < 0) |