Comment

Comment by heisenzombie

Not really, a units systems needs to be able to combine units in a useful way, like if I typed this:

  radius = 15 [mm]
  area = pi*radius^3
  force = 100 [N]

  def will_i_blow_up(pressure [Pa]):
    if(pressure > 1 [Gpa]):
      return "Oh no it blew up"

  will_i_blow_up( force/area )
should raise an error like "UnitsException, [N/mm^3] is not compatible with [Pa]". I could then look over my code and realize I should have written:

    area = pi*radius^2

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton