# std/math: add ldexp and make scalbn an alias · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/8f1e417757f2172485cdea792580e2a2afb53ffa)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 8f1e417757f2172485cdea792580e2a2afb53ffa

Requested commit: 8f1e417757f2172485cdea792580e2a2afb53ffa

Commit: 8f1e417757f2172485cdea792580e2a2afb53ffa

Tree: 42b7f53a6b872f5c8afaec97f24785bbb0e5d5cb

Author: Marc Tiehuis

Committer: Andrew Kelley

## Message

```
std/math: add ldexp and make scalbn an alias

We assume we are compiled on a base-2 radix floating point system. This
is a reasonable assumption. musl libc as an example also assumes this.

We implement scalbn as an alias for ldexp, since ldexp is defined as 2
regardless of the float radix. This is opposite to musl which defines
scalbn in terms of ldexp.

Closes #9799.

```

## Parents

- [8e6c038dd81fa7eddfdac882aa3b1d5edbdcf329](https://git.cafe/gitcafe/zig/commit/8e6c038dd81fa7eddfdac882aa3b1d5edbdcf329?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/8f1e417757f2172485cdea792580e2a2afb53ffa?format=markdown)
