Changeset 3c0ec68


Ignore:
Timestamp:
May 24, 2017, 6:03:08 PM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
a933bcb3
Parents:
daf9671
Message:

remove routines fabs and cabs from math

Location:
src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/math

    rdaf9671 r3c0ec68  
    1010// Created On       : Mon Apr 18 23:37:04 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Apr 24 12:45:02 2016
    13 // Update Count     : 59
     12// Last Modified On : Wed May 24 17:40:39 2017
     13// Update Count     : 60
    1414//
    1515
     
    2020#include <math.h>                                                                               // fpclassify, isfinite, isnormal, isnan, isinf
    2121} // extern "C"
    22 
    23 float fabs( float );
    24 // extern "C" { double fabs( double ); }
    25 long double fabs( long double );
    26 float cabs( float _Complex );
    27 // extern "C" { double cabs( double _Complex ); }
    28 long double cabs( long double _Complex );
    2922
    3023float ?%?( float, float );
  • src/libcfa/math.c

    rdaf9671 r3c0ec68  
    1010// Created On       : Tue Apr 19 22:23:08 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Apr 24 08:52:31 2016
    13 // Update Count     : 75
     12// Last Modified On : Tue May 23 22:52:13 2017
     13// Update Count     : 76
    1414//
    1515
     
    1919#include <complex.h>
    2020} // extern "C"
    21 
    22 float fabs( float x ) { return fabsf( x ); }
    23 long double fabs( long double x ) { return fabsl( x ); }
    24 float cabs( float _Complex x ) { return cabsf( x ); }
    25 long double cabs( long double _Complex x ) { return cabsl( x ); }
    2621
    2722float ?%?( float x, float y ) { return fmodf( x, y ); }
  • src/tests/.expect/64/math.txt

    rdaf9671 r3c0ec68  
    1 fabs: 1 1 1 1.41421 1.41421356237309505 1.41421356237309505
    2 fmod: 1 1 1 1 1 1
    3 remainder: -1 -1 -1
    4 remquo: 7 0.0999999 7 0.1 7 0.0999999999999999999
    5 div: 7 0.0999999 7 0.1 7 0.0999999999999999999
    6 fma: -2 -2 -2
    7 fdim: 2 2 2
    8 nan: nan nan nan
    9 exp: 2.71828 2.71828182845905 2.71828182845904524 1.46869+2.28736i 1.46869393991589+2.28735528717884i 1.46869393991588516+2.28735528717884239i
    10 exp2: 2 2 2
    11 expm1: 1.71828 1.71828182845905 1.71828182845904524
    12 log: 0 0 0 0.346574+0.785398i 0.346573590279973+0.785398163397448i 0.346573590279972655+0.78539816339744831i
    13 log2: 3 3 3
    14 log10: 2 2 2
    15 log1p: 0.693147 0.693147180559945 0.693147180559945309
    16 ilogb: 0 0 0
    17 logb: 3 3 3
    18 sqrt: 1 1 1 1.09868+0.45509i 1.09868411346781+0.455089860562227i 1.09868411346780997+0.455089860562227341i
    19 cbrt: 3 3 3
    20 hypot: 1.41421 1.4142135623731 1.41421356237309505
    21 pow: 1 1 1 0.273957+0.583701i 0.273957253830121+0.583700758758615i 0.273957253830121071+0.583700758758614628i
    22 sin: 0.841471 0.841470984807897 0.841470984807896507 1.29846+0.634964i 1.29845758141598+0.634963914784736i 1.29845758141597729+0.634963914784736108i
    23 cos: 0.540302 0.54030230586814 0.540302305868139717 0.83373-0.988898i 0.833730025131149-0.988897705762865i 0.833730025131149049-0.988897705762865096i
    24 tan: 1.55741 1.5574077246549 1.55740772465490223 0.271753+1.08392i 0.271752585319512+1.08392332733869i 0.271752585319511717+1.08392332733869454i
    25 asin: 1.5708 1.5707963267949 1.57079632679489662 0.666239+1.06128i 0.666239432492515+1.06127506190504i 0.666239432492515255+1.06127506190503565i
    26 acos: 0 0 0 0.904557-1.06128i 0.904556894302381-1.06127506190504i 0.904556894302381364-1.06127506190503565i
    27 atan: 0.785398 0.785398163397448 0.78539816339744831 1.01722+0.402359i 1.01722196789785+0.402359478108525i 1.01722196789785137+0.402359478108525094i
    28 atan2: 0.785398 0.785398163397448 0.78539816339744831 atan: 0.785398 0.785398163397448 0.78539816339744831 sinh: 1.1752 1.1752011936438 1.17520119364380146 0.634964+1.29846i 0.634963914784736+1.29845758141598i 0.634963914784736108+1.29845758141597729i
    29 cosh: 1.54308 1.54308063481524 1.54308063481524378 0.83373+0.988898i 0.833730025131149+0.988897705762865i 0.833730025131149049+0.988897705762865096i
    30 tanh: 0.761594 0.761594155955765 0.761594155955764888 1.08392+0.271753i 1.08392332733869+0.271752585319512i 1.08392332733869454+0.271752585319511717i
    31 acosh: 0 0 0 1.06128+0.904557i 1.06127506190504+0.904556894302381i 1.06127506190503565+0.904556894302381364i
    32 asinh: 0.881374 0.881373587019543 0.881373587019543025 1.06128+0.666239i 1.06127506190504+0.666239432492515i 1.06127506190503565+0.666239432492515255i
    33 atanh: inf inf inf 0.402359+1.01722i 0.402359478108525+1.01722196789785i 0.402359478108525094+1.01722196789785137i
    34 erf: 0.842701 0.842700792949715 0.842700792949714869
    35 erfc: 0.157299 0.157299207050285 0.157299207050285131
    36 lgamma: 1.79176 1.79175946922805 1.791759469228055
    37 lgamma: 1.79176 1 1.79175946922805 1 1.791759469228055 1
    38 tgamma: 6 6 6
    39 floor: 1 1 1
    40 ceil: 2 2 2
    41 trunc: 3 3 3
    42 rint: 2 2 2
    43 rint: 2 2 2
    44 rint: 2 2 2
    45 lrint: 2 2 2
    46 llrint: 2 2 2
    47 nearbyint: 4 4 4
    48 round: 2 2 2
    49 round: 2 2 2
    50 round: 2 2 2
    51 lround: 2 2 2
    52 llround: 2 2 2
    53 copysign: -1 -1 -1
    54 frexp: 0.5 3 0.5 3 0.5 3
    55 ldexp: 8 8 8
    56 modf: 2 0.3 2 0.3 2 0.3 nextafter: 2 2 2
    57 nexttoward: 2 2 2
    58 scalbn: 16 16 16
    59 scalbln: 16 16 16
     1fmod:1 1 1 1 1 1
     2remainder:-1 -1 -1
     3remquo:7 0.0999999 7 0.1 7 0.0999999999999999999
     4div:7 0.0999999 7 0.1 7 0.0999999999999999999
     5fma:-2 -2 -2
     6fdim:2 2 2
     7nan:nan nan nan
     8exp:2.71828 2.71828182845905 2.71828182845904524 1.46869+2.28736i 1.46869393991589+2.28735528717884i 1.46869393991588516+2.28735528717884239i
     9exp2:2 2 2
     10expm1:1.71828 1.71828182845905 1.71828182845904524
     11log:0 0 0 0.346574+0.785398i 0.346573590279973+0.785398163397448i 0.346573590279972655+0.78539816339744831i
     12log2:3 3 3
     13log10:2 2 2
     14log1p:0.693147 0.693147180559945 0.693147180559945309
     15ilogb:0 0 0
     16logb:3 3 3
     17sqrt:1 1 1 1.09868+0.45509i 1.09868411346781+0.455089860562227i 1.09868411346780997+0.455089860562227341i
     18cbrt:3 3 3
     19hypot:1.41421 1.4142135623731 1.41421356237309505
     20pow:1 1 1 0.273957+0.583701i 0.273957253830121+0.583700758758615i 0.273957253830121071+0.583700758758614628i
     21sin:0.841471 0.841470984807897 0.841470984807896507 1.29846+0.634964i 1.29845758141598+0.634963914784736i 1.29845758141597729+0.634963914784736108i
     22cos:0.540302 0.54030230586814 0.540302305868139717 0.83373-0.988898i 0.833730025131149-0.988897705762865i 0.833730025131149049-0.988897705762865096i
     23tan:1.55741 1.5574077246549 1.55740772465490223 0.271753+1.08392i 0.271752585319512+1.08392332733869i 0.271752585319511717+1.08392332733869454i
     24asin:1.5708 1.5707963267949 1.57079632679489662 0.666239+1.06128i 0.666239432492515+1.06127506190504i 0.666239432492515255+1.06127506190503565i
     25acos:0 0 0 0.904557-1.06128i 0.904556894302381-1.06127506190504i 0.904556894302381364-1.06127506190503565i
     26atan:0.785398 0.785398163397448 0.78539816339744831 1.01722+0.402359i 1.01722196789785+0.402359478108525i 1.01722196789785137+0.402359478108525094i
     27atan2:0.785398 0.785398163397448 0.78539816339744831 atan:0.785398 0.785398163397448 0.78539816339744831 sinh:1.1752 1.1752011936438 1.17520119364380146 0.634964+1.29846i 0.634963914784736+1.29845758141598i 0.634963914784736108+1.29845758141597729i
     28cosh:1.54308 1.54308063481524 1.54308063481524378 0.83373+0.988898i 0.833730025131149+0.988897705762865i 0.833730025131149049+0.988897705762865096i
     29tanh:0.761594 0.761594155955765 0.761594155955764888 1.08392+0.271753i 1.08392332733869+0.271752585319512i 1.08392332733869454+0.271752585319511717i
     30acosh:0 0 0 1.06128+0.904557i 1.06127506190504+0.904556894302381i 1.06127506190503565+0.904556894302381364i
     31asinh:0.881374 0.881373587019543 0.881373587019543025 1.06128+0.666239i 1.06127506190504+0.666239432492515i 1.06127506190503565+0.666239432492515255i
     32atanh:inf inf inf 0.402359+1.01722i 0.402359478108525+1.01722196789785i 0.402359478108525094+1.01722196789785137i
     33erf:0.842701 0.842700792949715 0.842700792949714869
     34erfc:0.157299 0.157299207050285 0.157299207050285131
     35lgamma:1.79176 1.79175946922805 1.791759469228055
     36lgamma:1.79176 1 1.79175946922805 1 1.791759469228055 1
     37tgamma:6 6 6
     38floor:1 1 1
     39ceil:2 2 2
     40trunc:3 3 3
     41rint:2 2 2
     42rint:2 2 2
     43rint:2 2 2
     44lrint:2 2 2
     45llrint:2 2 2
     46nearbyint:4 4 4
     47round:2 2 2
     48round:2 2 2
     49round:2 2 2
     50lround:2 2 2
     51llround:2 2 2
     52copysign:-1 -1 -1
     53frexp:0.5 3 0.5 3 0.5 3
     54ldexp:8 8 8
     55modf:2 0.3 2 0.3 2 0.3 nextafter:2 2 2
     56nexttoward:2 2 2
     57scalbn:16 16 16
     58scalbln:16 16 16
  • src/tests/math.c

    rdaf9671 r3c0ec68  
    1010// Created On       : Fri Apr 22 14:59:21 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Apr 24 13:24:20 2016
    13 // Update Count     : 70
     12// Last Modified On : Wed May 24 13:04:33 2017
     13// Update Count     : 71
    1414//
    1515
     
    2222        long double l;
    2323
    24         sout | "fabs:" | fabs( -1.0F ) | fabs( -1.0D ) | fabs( -1.0L ) | cabs( -1.0F+1.0FI ) | cabs( -1.0D+1.0DI ) | cabs( -1.0DL+1.0LI ) | endl;
    2524        sout | "fmod:" | 5.0F % -2.0F | fmod( 5.0F, -2.0F ) | 5.0D % -2.0D | fmod( 5.0D, -2.0D ) | 5.0L % -2.0L | fmod( 5.0L, -2.0L ) | endl;
    2625        sout | "remainder:" | remainder( 2.0F, 3.0F ) | remainder( 2.0D, 3.0D ) | remainder( 2.0L, 3.0L ) | endl;
Note: See TracChangeset for help on using the changeset viewer.