We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3fc0f46 commit 22bd929Copy full SHA for 22bd929
awk/src/interpreter/mod.rs
@@ -1222,7 +1222,11 @@ macro_rules! compare_op {
1222
$stack.push_value(bool_to_f64(lhs $op rhs))?;
1223
}
1224
(AwkValueVariant::String(lhs), AwkValueVariant::String(rhs)) => {
1225
- $stack.push_value(bool_to_f64(lhs.as_str() $op rhs.as_str()))?;
+ if lhs.is_numeric && rhs.is_numeric {
1226
+ $stack.push_value(bool_to_f64(strtod(lhs) $op strtod(rhs)))?;
1227
+ } else {
1228
+ $stack.push_value(bool_to_f64(lhs.as_str() $op rhs.as_str()))?;
1229
+ }
1230
1231
(AwkValueVariant::Number(lhs), AwkValueVariant::UninitializedScalar) => {
1232
$stack.push_value(bool_to_f64(*lhs $op 0.0))?;
0 commit comments