7

Whenever I compile less files to css on my computer (Ubuntu 13.10, AMD64) I get a very different floating point result than when my colleague compiles on his machine (Mac OSX 10.6). Which is all well and good. Floating point math etc, etc. The numbers are essentially the same. Blah blah.

But it makes diffing and committing the output really annoying. I end up with hundreds of these to ignore:

.col-lg-offset-10 {
  margin-left: 83.33333333%;
  margin-left: 83.33333333333334%;
}

What can I do to avoid this problem?

aychedee
  • 24,871
  • 8
  • 79
  • 83
  • This might interest you http://www.math.utah.edu/~beebe/software/ndiff/ – High Performance Mark Mar 14 '14 at 11:56
  • So I could use ndiff as an external git diff provider: http://stackoverflow.com/questions/255202/how-do-i-view-git-diff-output-with-a-visual-diff-program – aychedee Mar 14 '14 at 12:03
  • Are your versions of node, less compiler etc. the same as your colleague's? – iperelivskiy Mar 14 '14 at 12:13
  • Yes! You are correct. An upgrade to less 1.7 on my behalf fixed the problem. Why don't you post that as an answer and I'll mark it answered – aychedee Mar 14 '14 at 13:16
  • @seven-phases-max: I really think you should make your comment an answer to this question since (1) it was confirmed that this was the issue (so even though the question thought it was a platform issue, it was not), and (2) this change in LESS is a highly obscure fact that could benefit others who might have a similar issue, and benefit from any source link you could provide (if there is one) about this change in LESS. – ScottS Mar 16 '14 at 11:11
  • Yes one of you should, or I'm going to answer it myself in 24 hours :P – aychedee Mar 16 '14 at 11:14
  • I deleted my comment above in favor of the answer below (since the answer also corrects the Less version this was changed with). – seven-phases-max Mar 16 '14 at 15:23

1 Answers1

2

Most likely you're using different Less versions. Less (since version 1.6.2) rounds output numbers to 8 digits after the decimal point. So the solution is to sync the Less tools you and your colleague use.

seven-phases-max
  • 11,765
  • 1
  • 45
  • 57