Skip to content

2.0.0

Compare
Choose a tag to compare
@zcohan zcohan released this 04 Jun 21:37

New CurrencyRateProvider protocol (breaking change)

  • There is a new currencyRateProvider property on an EngineCustomization
  • A currency rate provider returns rates on demand. This is an improvement from SoulverCore 1.x, where rates were set on an EngineCustomization object directly. This meant you had to recreate your LineCollection or Calculator objects with a new EngineCustomization whenever the rates changed
  • The CurrencyList class is no longer available. If you used it to fetch rates from Nomics and/or CurrencyLayer, you will need to fetch those rates yourself and provide them to SoulverCore via an object that conforms to CurrencyRateProvider

New scientific units

  • Force (newtons, poundals, & pounds of force)
  • Accelleration (m/s^2, ft/s^2)
  • Torque (newton meters, pound feet, pound inches)
  • Pressure (pascals, atmospheres, bars, pounds per square inch)
  • Angular velocity (radians/s, revolutions/s, revolutions/min)
  • Angles (arc second and arc minute)
  • Substance (moles, molar)
  • Electrical units (electric conductance, inductance, capacitance, magnetic flux and flux density)
  • Fuel consumption (liters/km, liters/100 km) & fuel economy (miles/gallon, km/liter)

Statistics of lists of numbers

total/sum of 9, 12, 4, 2, 8 (= 35)
average of 5, 6 and 20 (= 10.33)
median of 9, 3, 4, 12 = (6.5)

Inflation

what is $500 today worth in 1997 (= $285.44)
what is $285.44 from 1997 worth today (= $500.0)
$1 from 1997 is worth what today (= $1.75)

Inflation predicting

what will $500 be worth in 2024 given 5% inflation (= $453.51)
value of $500 in 2024 assuming 5% inflation (= $453.51)
purchasing power of $500 in 2024 at 5% inflation (= $453.51)

New conditional syntaxes

a = 5 if b > 4 else 3
a = if b > 4 then 5 else 3
x = 900 unless y = 30

Bitwise operators

0b1100 | 0b1110 (= 0b1110)
0b0101 & 0b1010 (= 0b0)
0b1010 xor 0b1011 (= 0b1)
0b100 << 1 (= 0b1000)
0b100 >> 2 (= 0b1)

Sales Tax/GSTVAT calculations

sales tax in $50
$129 - VAT

To use this feature, set a variable on your VariableList whose definition is SalesTax EvaluationResult:

var variable = Variable(name: "sales tax", value: nil)
variable.definition = EvaluationResult.salesTax(SalesTax(decimalValue: 0.15))

Screen Density

  • ppi of 15" screen at 1024x768 (= 85.33 PPI)

Cars & Tyres

  • speed of 12 inch tyre at 522 rpm = (18.63 mph)

Bug fixes

  • Numerous minor bug fixes