MCPcopy Create free account
hub / github.com/elftausend/graplot / get_steps

Function get_steps

src/eval.rs:80–103  ·  view source on GitHub ↗
(max: f64, mut min_steps: f64)

Source from the content-addressed store, hash-verified

78const MIN_MIN_STEPS: f64 = 3.;
79
80pub fn get_steps(max: f64, mut min_steps: f64) -> f64 {
81 //let mut steps = 4.;
82 if max >= min_steps {
83 while max % min_steps != 0. {
84 min_steps += 1.;
85
86 if min_steps == MAX_MIN_STEPS {
87 return MAX_MIN_STEPS;
88 }
89 }
90 return min_steps;
91 }
92 /*
93 let max = count_inv_tens(max) as f64 * max * 10.;
94 while max % min_steps != 0. {
95 min_steps -= 1.;
96 println!("min_steps: {min_steps}");
97 }
98 */
99 if min_steps < MIN_MIN_STEPS {
100 return MIN_MIN_STEPS;
101 }
102 min_steps
103}
104
105pub fn max_display(max: f64, other_scaling: bool) -> f64 {
106 if max == 0. {

Callers 2

runFunction · 0.85
showMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected