Macaulay2 / Macaulay2/M2

quotient and modulus for non-integers are wrong

Open
#3,340 3 comments 0 reactions 1 assignee Claimed by @mahrud View on GitHub
Core
Dominant language
Macaulay2
Stars
435
Forks
297
Avg merge
4d 20h
Merged PRs (30d)
11

Description

Unless I'm way off about what we want `//` and `%` to mean, I think these are all wrong:
https://github.com/Macaulay2/M2/blob/ec9e9ac60ed4a8e791448942202f077a88a87e15/M2/Macaulay2/m2/reals.m2#L213-L226

Some examples: (afterprints are silenced)
```m2
i1 : 13.3 // 4.0

o1 = 3.325

i2 : 13.3 % 4.0

o2 = 0

i3 : 13.3 // 4

o3 = 3.325

i4 : 13.3 % 4

o4 = 0

i5 : 13.3 // (4/1)

o5 = 3.325

i6 : 13.3 % (4/1)

o6 = 0

i7 : (pi*ii) // 3.0

o7 = 1.0471975511966*ii

i8 : (pi*ii) % 3.0

o8 = 0
```
What's the point of having `//` be a synonym for `/`, and why even define `%` for non-integers if the answer is always zero anyway?!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.