google / google/j2cl

Add support for Math.IEEEremainder

Open
#142 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.4k
Forks
161
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**

`Math.IEEEremainder` isn't implemented and is commented as such at: https://github.com/google/j2cl/blob/master/jre/java/java/lang/Math.java#L34

**Describe the solution you'd like**

Add support for [Math.IEEEremainder](https://docs.oracle.com/javase/7/docs/api/java/lang/Math.html#IEEEremainder(double,%20double))

**Describe alternatives you've considered**

I attempted an implementation based on this [doc](https://docs.microsoft.com/en-us/dotnet/api/system.math.ieeeremainder):

```java
static private double IEEEremainder(double dividend, double divisor) {
return dividend - (divisor * Math.round(dividend / divisor));
}
```

**Additional context**

The link above shows expected output, and there are [tests](https://github.com/JetBrains/kotlin/blob/92d200e093c693b3c06e53a39e0b0973b84c7ec5/libraries/stdlib/jvm/test/numbers/MathJVMTest.kt) for the Kotlin implementation.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.