Proto-App / Proto-Android

Realtime circuit simulator for Android platform.
100 stars 4 forks source link

a short question #354

Closed Jurgen2003 closed 2 days ago

Jurgen2003 commented 1 week ago

dear @Proto-App is it possible to determine in javascript the min , max over 2 inputs for example input 1 has 5 volts and input 2 has 7.5 volts that output 1 then sends out 7.5 but becomes input 1 10 volts output 1 10 volts so over 2 inputs the highest send out
if so how does it work I am trying it does not work
greeting Jurgen

Proto-App commented 3 days ago

Hello @Jurgen2003 Sure, you can use Math.max function: let maxVoltage = Math.max(in0.getVoltage(), in1.getVoltage());

Jurgen2003 commented 3 days ago

Thank you

Proto-App commented 3 days ago

@Jurgen2003 Can we close this topic?

Jurgen2003 commented 2 days ago

the minumale is then let minVoltage = Math.min(in0.getVoltage(), in1.getVoltage()); thanks and can be closed

Proto-App commented 2 days ago

Yes, Math.min for minimum value.