www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23538] New: Power operator does not work in -betterC

https://issues.dlang.org/show_bug.cgi?id=23538

          Issue ID: 23538
           Summary: Power operator does not work in -betterC
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: alphaglosined gmail.com

As of dmd 2.101.0 power operator doesn't work in -betterC for double/double.

Due to using std.math : pow as the hook for this expression, which depends upon
exp2 which isn't templated.


```
extern(C) void main() {
    double input = 3f;
    double power = 2;
    double calculated = input ^^ power;
}
```

```
verify_pow_reg.obj : error LNK2019: unresolved external symbol
__D3std4math11exponential4exp2FNaNbNiNeeZe referenced in function
__D3std4math11exponential__T3powTdTdZQjFNaNbNiNeddZ4implFNaNbNiNfeeZe
```

--
Dec 04 2022