Search
 
SCRIPT & CODE EXAMPLE
 

RUST

rust BMI

fn bmi(weight: u32, height: f32) -> &'static str {
    let index = weight as f32 / height.powi(2);
    match index {
        index if index <= 18.5 => "Underweight",
        index if index <= 25.0 => "Normal",
        index if index <= 30.0 => "Overweight",
        _ => "Obese"
    }
}
Comment

rust BMI

fn bmi(weight: u32, height: f32) -> &'static str {
    let index = weight as f32 / height.powi(2);
    match index {
        index if index <= 18.5 => "Underweight",
        index if index <= 25.0 => "Normal",
        index if index <= 30.0 => "Overweight",
        _ => "Obese"
    }
}
Comment

PREVIOUS NEXT
Code Example
Rust :: armanriazi•rust•static 
Rust :: armanriazi•rust•error•E0308•mismatched types expected type parameter ``, found associated type 
Rust :: armanriazi•rust•error•[E0369]: binary operation `=` cannot be applied to type `T` 
Rust :: armanriazi•rust•error•E0308•mismatched types 
Rust :: rust ceil 
Rust :: rust fill vector with range 
Rust :: rust program name 
Rust :: rust print i8 
Rust :: Vector with multiple types in rust 
Rust :: rust closeure 
Rust :: armanriazi•rust•unsafe•safeabstraction 
Rust :: armanriazi•rust•comparison•generic•associated type 
Lua :: kerbal space program 2 
Lua :: roblox get player from character 
Lua :: lua for each in table 
Lua :: roblox how to make debounce 
Lua :: lua table is empty 
Lua :: roblox go thru all players 
Lua :: what is the point of local varaibles in lua 
Lua :: lua list of all keys 
Lua :: lua tables 
Lua :: What is CanCollide in roblox? 
Lua :: lua string 
Lua :: fivem get closest player 
Lua :: roblox manually stop command bar loops 
Matlab :: matlab get row from matrix 
Matlab :: display sequence in matlab 
Matlab :: zsh corrupt history file 
Basic :: floppy disk drive +arduino 
Elixir :: elixir fibonacci 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =