Please feel free to provide feedback or file bugs here.

log2 45/120 should be valid syntax

Given a function:
function log2 {param ([double]$x) [Math]::Log($x) / [Math]::Log(2) }
Expected: log2 45/120 should yield -1.41503749928
Actual:
log2 : Cannot process argument transformation on parameter 'x'. Cannot convert value "45/120" to type "System.Double".
Error: "Input string was not in a correct format."
At line:1 char:6
+ log2 45/120
+ ~~~~~~
+ CategoryInfo : InvalidData: (:) [log2], ParameterBindingArgumentTransformationException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,log2

1 vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)

    We’ll send you updates on this idea

    Ivan Akcheurov shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    1 comment

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base