microsoft / microsoft/Power-Fx

RoundUp doesn't error for large negative number of digits

Open
#1,823 0 comments 0 reactions 1 assignee View on GitHub

@anderson-joyle is already working on this.

Since Sep 21, 2023.

Dominant language
C#
Stars
3.4k
Forks
358
Avg merge
10h 34m
Merged PRs (30d)
3

Description

Two problems, with decimal

> RoundUp( 123.12345678919, -28 )
10000000000000000000000000000

> RoundUp( 123.12345678919, -29 )
0

We should generate a runtime overflow error for the second case, consistent with #NUM! in Excel.

For floating point

> RoundUp( Float(123.12345678919), -14 )
100000000000000

> RoundUp( Float(123.12345678919), -15 )
999999999999999.9

> RoundUp( Float(123.12345678919), -16 )
123.12345678919

> RoundUp( Float(123.12345678919), -300 )
123.12345678919

> RoundUp( Float(123.12345678919), -400 )
123.12345678919

Not at all consistent with Excel, all numbers should be 1 with a variable number of zeros following. -14, -15, and -16 is an interesting sequence. For -400, we should generate an error.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.