Type Casting ============ ```Example from 1 languages: C double da = 3.3; double db = 3.3; double dc = 3.4; int result = (int)da + (int)db + (int)dc; //result == 9 ``` ```Example from 1 languages: TypeScript <number>something; ``` ```Example from 1 languages: C# Animal animal = new Cat(); Bulldog b = (Bulldog) animal; // if (animal is Bulldog), stat.type(animal) is Bulldog, else an exception b = animal as Bulldog; // if (animal is Bulldog), b = (Bulldog) animal, else b = null animal = null; b = animal as Bulldog; // b == null ``` ```Example from 1 languages: MATLAB b = cast(a, 'like', p) ``` ```Example from 1 languages: Chapel : ``` ```Example from 1 languages: C3 double d = 3.3; int x = (int)d; ``` ```Example from 1 languages: Jule let x = (int)(3.14) ``` ```Example from 1 languages: Speedie || x = message() || y = x|object| // lose type info || z = y|message| // regain it ``` * Languages *with* Type Casting include C, TypeScript, C#, MATLAB, Chapel, C3, Jule, Speedie * View all concepts with or missing a *hasExplicitTypeCasting* measurement http://pldb.info/../lists/explorer.html#columns=rank~id~appeared~tags~creators~hasExplicitTypeCasting&searchBuilder=%7B%22criteria%22%3A%5B%7B%22condition%22%3A%22null%22%2C%22data%22%3A%22hasExplicitTypeCasting%22%2C%22origData%22%3A%22hasExplicitTypeCasting%22%2C%22type%22%3A%22num%22%2C%22value%22%3A%5B%5D%7D%5D%2C%22logic%22%3A%22AND%22%7D missing http://pldb.info/../lists/explorer.html#columns=rank~id~appeared~tags~creators~hasExplicitTypeCasting&searchBuilder=%7B%22criteria%22%3A%5B%7B%22condition%22%3A%22!null%22%2C%22data%22%3A%22hasExplicitTypeCasting%22%2C%22origData%22%3A%22hasExplicitTypeCasting%22%2C%22type%22%3A%22num%22%2C%22value%22%3A%5B%5D%7D%5D%2C%22logic%22%3A%22AND%22%7D with * Read more about Type Casting on the web: 1. https://en.wikipedia.org/wiki/Type_conversion 1. Built with Scroll v178.2.3