question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Math Functions] Should math functions output -0?

See original GitHub issue

Some functions in the Math Functions proposal output -0, e.g. sqrt(-0). Is it important to preserve the sign on -0? Can we just truncate that to 0?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
nex3commented, Dec 18, 2019

I don’t think we need to let sass/dart-sass#807 block math functions. -0 and integer 0 are nearly indistinguishable in Sass anyway, so I think just making the internal representation be a float for this case for now should be sufficient.

0reactions
Awjincommented, Dec 18, 2019

This means that currently, if we do get a -0 value, it’s just emitted as 0 which I think is totally reasonable.

Sounds good. Followup question: the current proposal draft is specifying the output of the function (-0). Should it specify the outputted CSS (0) instead?

As per sass/dart-sass#807, we’ll probably switch to always storing them as floating-point relatively soon.

Should we move forward with this to avoid special-casing for -0? Currently it gets parsed as an integer and stored as 0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Zero Function - Meaning, Graph, Examples - Cuemath
A zero function is a constant function for which the output value is always zero irrespective of the inputs.
Read more >
Is there a function that returns either 0 or 1 with the input being ...
I basically need the function to output 1 if the variable isn't 0. Is this even possible? calculus · Share.
Read more >
Math Input & Output Function Formats & Examples - Study.com
The function states that given any input, x, the function will produce an output, x + 5. Here are a few other examples...
Read more >
What is a Function - Math is Fun
It is like a machine that has an input and an output. ... We will see many ways to think about functions, but...
Read more >
1.1: Four Ways to Represent a Function - Math LibreTexts
We say “the output is a function of the input.” ... We will set each factor equal to 0 and solve for p...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found