diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-11-08 14:07:22 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-11-08 14:23:38 +0100 |
commit | 596dfe7d6c6bf355aca4eca0a2386f9c5679887d (patch) | |
tree | bdbde402e2e12a5ca6ca0951fc83fb7bc87b533d /libavutil | |
parent | 046218b212a076b92ed88a280457db871dafd377 (diff) | |
download | ffmpeg-streaming-596dfe7d6c6bf355aca4eca0a2386f9c5679887d.zip ffmpeg-streaming-596dfe7d6c6bf355aca4eca0a2386f9c5679887d.tar.gz |
avutil/softfloat: Add tests for exponent underflows
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/softfloat.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libavutil/softfloat.c b/libavutil/softfloat.c index a9d1b0c..1691de8 100644 --- a/libavutil/softfloat.c +++ b/libavutil/softfloat.c @@ -97,6 +97,18 @@ int main(void){ sf1 = av_int2sf(0xE0000001, 0); printf("test4 softfloat: %.10lf (0x%08x %d)\n", (double)av_sf2double(sf1), sf1.mant, sf1.exp); + + sf1 = (SoftFloat){ 0x20000000, MIN_EXP }; + sf1 = av_mul_sf(sf1, sf1); + printf("test5 softfloat: %.10lf (0x%08x %d)\n", (double)av_sf2double(sf1), sf1.mant, sf1.exp); + + sf1 = (SoftFloat){ 0x20000000, MIN_EXP }; + sf2 = (SoftFloat){ 0x20000000, MAX_EXP }; + i = av_cmp_sf(sf1, sf2); + j = av_cmp_sf(sf2, sf1); + sf1 = av_div_sf(sf1, sf2); + printf("test6 softfloat: %.10lf (0x%08x %d) %d %d\n", (double)av_sf2double(sf1), sf1.mant, sf1.exp, i, j); + for(i= 0; i<4*36; i++){ int s, c; double errs, errc; |