首页 > 解决方案 > Is there a gnuplot setting to interpret ints as floats?

问题描述

gnuplot has the well-known gotcha of integer division, so 1/2 = 0. Float literals are one solution: 1./2 or 1/2..

I use gnuplot as a calculator, e.g. pr 1/2 (print abbr), and it's easy to forget the ., and there's no warning. I've never actually wanted integer arithmetic.

Is there a setting to force floating point arithmetic --- to interpret integers as floats? (to have in my ~/.gluplot config)

标签: gnuplot

解决方案


推荐阅读