[Question]
  [
I think we've all done this as a kid: some websites require a minimum age of 18, so we just subtract a few years from the year of birth and voilà, we 'are' 18+.  
In addition, for most rides at amusement parks the minimum height to enter is 1.40 meters (here in The Netherlands it as at least). Of course this can be cheated less easily than age, but you could wear shoes with thick heels, put your hair up, wear a hat, stand on your toes, etc.
## Input:
Your program/function accepts a positive integer or decimal.
## Output:
* Is the input an integer `>= 18`? Simply print the input.
* Is the input an integer `0-17`? Print `18`.
* Is the input a decimal `>= 1.4`? Simply print the input.
* Is the input a decimal `0.0-1.4`? Print `1.4`.
# Challenge rules:
* Assume the input will always be in the range of `0-122` (oldest woman ever was 122) or `0.0-2.72` (tallest man ever was 2.72).
* You are allowed to take the input as a String, object, or anything else you prefer.
* The decimal inputs will never have more than three decimal places after the decimal point.
* `2` or `2.` both aren't valid outputs for `2.0`. You are free to output `2.00` or `2.000` instead of `2.0` however.  
Just like the input the output will never have more than three decimal places after the point.
## General rules:
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so shortest answer in bytes wins.  
Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
* [Standard rules apply](http://meta.codegolf.stackexchange.com/questions/2419/default-for-code-golf-program-function-or-snippet/2422#2422) for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters, full programs. Your call.
* [Default Loopholes](http://meta.codegolf.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default) are forbidden.
* If possible, please add a link with a test for your code.
* Also, please add an explanation if necessary.
## Test cases:
```
0      ->  18
1      ->  18
2      ->  18
12     ->  18
18     ->  18
43     ->  43
115    ->  115
122    ->  122
0.0    ->  1.4
1.04   ->  1.4
1.225  ->  1.4
1.399  ->  1.4
1.4    ->  1.4
1.74   ->  1.74
2.0    ->  2.0
2.72   ->  2.72
```
  
[Answer]
# Python 2.7, 34 bytes
```
lambda x:max(x,[18,1.4]['.'in`x`])
```
[Answer]
# JavaScript (ES6), 27 ~~31~~
Input taken as a string. To check if the input value has decimals, it's appended to itself: if there is no decimal point the result is still a valid number, else it's not. To recognize a valid number (including 0), I use division as in javascript `1/n` is numeric and not 0 for any numeric `n` (eventually the value is `Infinity` for `n==0`), else it's `NaN`
```
x=>x<(y=1/(x+x)?18:1.4)?y:x
```
**Test**
```
f=    
x=>x<(y=1/(x+x)?18:1.4)?y:x
;[
 ['0', '18' ],['1', '18' ],['2', '18' ],['12', '18' ],['18', '18' ],['43', '43' ],['115', '115'], ['122', '122' ]
,['0.0', '1.4'],['1.0', '1.4'],['1.04', '1.4'],['1.225', '1.4'],['1.399', '1.4'],['1.4', '1.4'],['1.74', '1.74'],['2.0', '2.0'],['2.72', '2.72']
].forEach(t=>{
  var i=t[0],k=t[1],r=f(i)
  console.log(i,k,r,k==r?'OK':'KO')
})
```
*My prev (wrong) solution:*
Taking input as a number, you can use remainder operator `%` to check if the number is integer.
```
x=>x<(y=x%1?1.4:18)?y:x
```
or
```
x=>Math.max(x,x%1?1.4:18)
```
But this does not work as the challenge request to discriminate between, say, `2` and `2.0` and that's the same number. So it's not possibile to get the input as a number
[Answer]
# [05AB1E](http://github.com/Adriandmen/05AB1E), ~~13~~ 11 bytes
Uses [CP-1252](http://www.cp1252.com/) encoding.
```
ÐîQ18*14T/M
```
**Explanation**
```
Ð             # triplicate input
 î            # round up
  Q           # check for equality
   18*        # multiply 18 by this (18 if input is int, else 0)
      14T/    # push 14 / 10
          M   # take max of stack (input and 1.4 or 18)
```
[Try it online](http://05ab1e.tryitonline.net/#code=w5DDrlExOCoxNFQvTQ&input=MS4z)
[Answer]
# Java 8, ~~90~~ ~~61~~ 57 bytes
```
i->(i+"").contains(".")?(float)i<1.4?1.4:i:(int)i<18?18:i
```
-4 bytes returning `Object` instead of `String`; and some additional bytes converting Java 7 to 8.  
-4 byte taking the input as `Object` instead of `String` as well.
**Explanation:**
[Try it here.](https://tio.run/##jY9BTsMwEEX3OcUoK1uoVuIGNU1bcgLKokvEwnUdNCG1o9qthFDOHhzIlg4LW575b/4ft@qmFq43tj19jLpT3sOzQvuVAKAN5tIobWA/lQAvx9boAJrND@Sb2B@SePmgAmrYg4UdjLh4YviQplxoZ0O08ywVKa9Z0zkVOG5zUdTxVFixmDI1yjovKxw3k1l/PXbRbPa8OTzBOZqwQ7igfX99A8V/Fzp8@mDOwl2D6KMUOsus0CzjP4v9qeeELql5EigJoFiSEfcy7s9mImsoe5EVNCPlIw0t12sa@kfYimQk/S8pVnJmhmQYvwE)
```
i->                      // Method with Object as both parameter and return-type
  (i+"").contains(".")?  //  If the input as String contains a dot:
   (float)i<1.4?         //   If the input is a float below 1.4:
    1.4                  //    Return double 1.4
   :                     //   Else:
    i                    //    Return the input-float as is
  :(int)i<18?            //  Else if the input is an integer below 18:
   18                    //   Return integer 18
  :                      //  Else:
   i                     //   Return the input-integer as is
```
[Answer]
# Pyth, 14 bytes
```
eS,@,18h.4}\.`
```
[Try it online.](http://pyth.herokuapp.com/?code=eS%2C%40%2C18h.4%7D%5C.%60&input=17&test_suite_input=12%0A18%0A36%0A1.5%0A2.0%0A1.0&debug=0)
[Answer]
# PHP, 40 Bytes
modified by @user59178 Thank You
```
<?=max(is_int(0+$i=$argv[1])?18:1.4,$i);
```
PHP, 42 Bytes first Version
```
<?=max(strpos($i=$argv[1],".")?1.4:18,$i);
```
[Answer]
# Perl, ~~29~~ 27 bytes
Includes +2 for `-lp`
Give input on STDIN
```
adult.pl <<< 1.24
```
`adult.pl`:
```
#!/usr/bin/perl -lp
$_>($a=/\./?1.4:18)or*_=a
```
If you don't mind an extra newline if you really were a full adult then leaving out the `l` option for 26 bytes works too
[Answer]
## EXCEL: ~~26~~ ~~31~~ 29 Bytes
```
=MAX(A1;IF(MOD(A1;1);1,4;18))
```
Formula can go anywhere except A1, the input cell.
Fixed errors, and replaced with Emigna's suggestion. 
Thanks to Alexandru for saving me some bytes using truths
[Answer]
# [Brachylog](http://github.com/JCumin/Brachylog), 14 bytes
```
#$:18ot|:1.4ot
```
[Try it online!](http://brachylog.tryitonline.net/#code=IyQ6MThvdHw6MS40b3Q&input=MS4zOTk&args=Wg)
### Explanation
```
    #$             Input is an integer
      :18o         Sort the list [Input, 18]
          t        Take the last element
|              Or
    :1.4o          Sort the list [Input, 1.4]
         t         Take the last element
```
[Answer]
# GNU sed, 40 + 1 = 41 bytes
(score +1 for use of `-r` flag to interpreter)
```
s/^.$|^1[^9]$/18/
/^0|1\.[0-3]/s/.*/1.4/
```
### Annotated:
```
#!/bin/sed -rf
# First, anything that's a single digit or is '1' followed by a
# digit other than '9' is replaced with '18'.
s/^.$|^1[^9]$/18/
# Now, any line beginning with '0' or containing '1.0' to '1.3' is
# replaced with '1.4'.
/^0|1\.[0-3]/s/.*/1.4/
```
We take advantage of the constraints on input, so don't have to test the start of string when we see '1.' - we know there's only one digit before the decimal point.
### Test result:
```
$ ./94832.sed <<END
> 0
> 1
> 2
> 12
> 18
> 43
> 122
> 
> 0.0
> 1.04
> 1.225
> 1.399
> 1.4
> 1.74
> 2.0
> 2.72
> END
18
18
18
18
18
43
122
1.4
1.4
1.4
1.4
1.4
1.74
2.0
2.72
```
[Answer]
## Haskell, 50 bytes
```
x#y=show$max x$read y 
f s|elem '.'s=1.4#s|1<2=18#s
```
Usage example: `f "1.0"` -> `"1.6"`.
Haskell's strict type requires usage of strings as input and output. Howevers, `read`, `max` and `show` are polymorphic and handle all numeric types.
[Answer]
# Java, ~~79~~ 70 bytes
```
int f(int x){return x<18?18:x;}
float f(float x){return x<1.4?1.4f:x;}
```
Defines two methods with overloading, which use the conditional operator.
Call it like `f(5)` or `f(1.4f)`. 
[Answer]
# [Convex](http://github.com/GamrCorps/Convex), 9 bytes
```
_1ÛI1.4?»
```
[Try it online!](http://convex.tryitonline.net/#code=XzHDm0kxLjQ_wrs&input=&args=NS4w)
[Answer]
# CJam, ~~18~~ 14 bytes
Saved 4 bytes thanks to Martin Ender.
```
q~_`'.&1.4I?e>
```
[Online interpreter](http://cjam.aditsu.net/#code=q%7E_%60%27.%261.4I%3Fe%3E&input=1.2)
[Answer]
# IBM/Lotus Notes Formula Language, ~~58~~ 49 bytes
```
@If(@Like(@Text(a);"%.%");@If(a<1.4;1.4;a);@If(a<18;18;a))
```
Computed field formula where a is an editable numeric field.
**EDIT**
```
@If(@Like(@Text(a);"%.%");@Max(1.4;a);@Max(18;a))
```
Alternative inspired by @Mego
[Answer]
# AWK - 29 bytes
```
($0<c=$0~/\./?1.4:18){$0=c}1
```
Usage:
```
awk '{c=$0~/\./?1.4:18}($0<c){$0=c}1' <<< number
```
Testing was performed with `gawk` on RHEL 6.
I tried with all the test cases, unfortunately I don't have `AWK` on the machine that has internet access, so copy-paste is not possible.
Is there a more compact way to do this in `AWK`?
[Answer]
# C#, 58 bytes
```
x=>x is int?(int)x>17?x:18:(float)x<1.4?"1.4":$"{x:.0##}";
```
No crazy string parsing needed for C#. Input is expected to be an `int` or `float` (unfortunately C# can't cast a `double` to `float` if the `double` is in an `object`). Output will be either `int` or `string` in an `object`.
(almost missed the at least 1 decimal requirement, added that now)
Ungolfed:
```
/*Func<object, object> Lambda = */ x =>
    x is int // if parameter is an int
        ? (int)x > 17 // check if x is at least 18
            ? x // at least 18 so return x
            : 18 // less than 18 so return 18
        : (float)x < 1.4 // x is float, check if at least 1.4
            ? "1.4" // less than 1.4 so return 1.4
            : $"{x:.0##"} // at least 1.4 so return x and ensure at least 1 decimal place
;
```
Alternate implementation which is also 58 bytes.
```
x=>x is int?(int)x>17?x:18:$"{((float)x<1.4?1.4:x):.0##}";
```
[Answer]
## Actually, 16 bytes
```
;:.7τ9τ($'.íuIkM
```
[Try it online!](http://actually.tryitonline.net/#code=OzouN8-EOc-EKCQnLsOtdUlrTQ&input=LjI)
Explanation:
```
;:.7τ9τ($'.íuIkM
;                 dupe input
 :.7τ             1.4 (.7*2) - note that :1.4 is the same length, but an additional delimiter would be needed to separate it from the following 1
     9τ           18 (9*2)
       ($'.íu     1-based index of "." in string representation of input, 0 if not found
             I    1.4 if input contains a "." else 18
              kM  maximum of remaining values on stack 
```
[Answer]
## Emacs Lisp, 37 bytes
```
(lambda(x)(max(if(floatp x)1.4 18)x))
```
Guesses from the "datatype" whether the integer or float version should be used. (`floatp` returns `t` for `1.0`, but not for `1.`) The parameter is a number as integer or float, i.e. it should satisfy `numberp`.
[Answer]
# Haskell, 49 bytes
```
x#y=show.max x.fst<$>reads y;f s=head$18#s++1.4#s
```
Basically, this first attempts to read the input as an integer and then as a double if that fails. Then proceeds to compare it to the respective comparison baseline.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~16 15 13~~ 12 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
-1 thanks to caird coinheringaahing (take input as a string).
```
ċ”.ị1.4,18»V
```
**[TryItOnline](https://tio.run/##y0rNyan8//9I96OGuXoPd3cb6pnoGFoc2h32//9/JSM9AyUA "Jelly - Try it online!")**  
Or see all test cases, also at **[TryItOnline](https://tio.run/##y0rNyan8//9I96OGuXoPd3cb6pnoGFoc2h3GdXTP4fZHTWu8gTjy////0UoGSjpKhkBsBKLBhAWQMDEGsQxNwYIgUQM9sEI9AxMwZWQEltIzNrYE0xBRcxBlBFZppGdupBQLAA "Jelly - Try it online!")**
How?
```
ċ”.ị1.4,18»V - Main link: string, S
 ”.          - '.' character
ċ            - count (occurrences of '.' in S)
    1.4,18   - pair literals 1.4 and 18:  [1.4,  18]
   ị         - index into (1-indexed)
           V - evaluate (S) as Jelly code
          »  - maximum
```
[Answer]
# C#, 69 bytes
```
s=>s.Contains(".")?float.Parse(s)<1.4?"1.4":s:int.Parse(s)<18?"18":s;
```
[**Try it online!**](http://ideone.com/53iScL)
Full program with test cases:
```
using System;
namespace YesImAnAdult
{
    class Program
    {
        static void Main(string[] args)
        {
            Func<string,string>f= s=>s.Contains(".")?float.Parse(s)<1.4?"1.4":s:int.Parse(s)<18?"18":s;
            
            Console.WriteLine(f("0"));  //18
            Console.WriteLine(f("1"));  //18
            Console.WriteLine(f("2"));  //18
            Console.WriteLine(f("12")); //18
            Console.WriteLine(f("18")); //18
            Console.WriteLine(f("43")); //43
            Console.WriteLine(f("122"));    //122
            Console.WriteLine(f("0.0"));    //1.4
            Console.WriteLine(f("1.04"));   //1.4
            Console.WriteLine(f("1.225"));  //1.4
            Console.WriteLine(f("1.399"));  //1.4
            Console.WriteLine(f("1.4"));    //1.4
            Console.WriteLine(f("1.74"));   //1.74
            Console.WriteLine(f("2.0"));    //2.0
            Console.WriteLine(f("2.72"));   //2.72
        }
    }
}
```
A pretty straightforward solution. Note that on some systems float.Parse() might return incorrect results. Pass *CultureInfo.InvariantCulture* as the second argument according to [this answer](https://stackoverflow.com/questions/16657090/why-does-float-parse-return-wrong-value).
[Answer]
# ~~[Dyalog APL](http://goo.gl/9KrKoM), 14 [bytes](https://codegolf.meta.stackexchange.com/a/9429/43319)~~ Rendered invalid by further specifications
`⎕IO←0` which is default on many systems. Takes string as argument.
```
⍎⌈18 1.4⊃⍨'.'∘∊
```
`⍎⌈` max of the evaluated argument and
`18 1.4⊃⍨` {18,1.4} selected by
`'.'∘∊` whether the argument contains a period
[Answer]
# C++, 68 bytes
```
int A(int a){return a<18?18:a;}float A(float h){return h<1.4?1.4:h;}
```
This answer is actually 2 functions with the same name, and the compiler works out for me which to call, so it acts as one function without me having to take in one input and decide which it is. Since input on the floating point is guaranteed to be of the same precision as the output, I can return it safely without having to truncate it either.
***Ungolfed + tests***
```
#include <iostream>
int A(int a)
{
   return a < 18 ? 18 : a;
}
float A(float h)
{
   return h < 1.4 ? 1.4 : h;
}
int main()
{
  std::cout << 0 << " " << A(0) << "\n";
  std::cout << 19 << " " << A(19) << "\n";
  std::cout << 1.1 << " " << A(1.1f) << "\n";
  std::cout << 2.2 << " " << A(2.2f) << "\n";
}
```
[Answer]
## C, 50 bytes:
```
#define A(x)(x/2+(x+1)/2-x?x<1.4?1.4:x:x<18?18:x)
```
The byte count includes the newline at the end of the macro definition.
[Test](http://melpon.org/wandbox/permlink/2d0kLPfsteRO9zzN):
```
#define A(x)(x/2+(x+1)/2-x?x<1.4?1.4:x:x<18?18:x)
#include <assert.h>
int main() {
  assert(A(0) == 18);
  assert(A(1) == 18);
  assert(A(2) == 18);
  assert(A(12) == 18);
  assert(A(18) == 18);
  assert(A(43) == 43);
  assert(A(115) == 115);
  assert(A(122) == 122);
  assert(A(0.0) == 1.4);
  assert(A(1.04) == 1.4);
  assert(A(1.225) == 1.4);
  assert(A(1.399) == 1.4);
  assert(A(1.4) == 1.4);
  assert(A(1.74) == 1.74);
  assert(A(2.0) == 2.0);
  assert(A(2.72) == 2.72);
}
```
[Answer]
# C#, 71 bytes
```
object A(object i){return i is int?(int)i>18?i:18:(double)i>1.4?i:1.4;}
```
try it [here](https://dotnetfiddle.net/6DFkdX)
[Answer]
# C, ~~119~~ ~~111~~ ~~105~~ 100
```
m;f(char*s){float atof(),l=atof(s);for(m=s;*s&&*s++!=46;);puts(*s?l<1.4?"1.4":m:atoi(m)>18?m:"18");}
```
Tested with
```
main(c,v)char**v;{
    f("0");
    f("1");
    f("2");
    f("12");
    f("18");
    f("44");
    f("115");
    f("122");
    f("0.0");
    f("1.04");
    f("1.225");
    f("1.339");
    f("1.4");
    f("1.74");
    f("2.0");
    f("2.72");
}
```
Output
```
18
18
18
12
18
44
115
122
1.4
1.4
1.4
1.4
1.4
1.74
2.0
2.72
```
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal) `ḋ`, ~~13~~ 12 bytes
```
₌⌊±[18|1.4]∴
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyJB4biLIiwiIiwi4oKM4oyKwrFbMTh8MS40XeKItCIsIiIsIlwiMFwiXG5cIjFcIlxuXCIyXCJcblwiMTJcIlxuXCIxOFwiXG5cIjQzXCJcblwiMTE1XCJcblwiMTIyXCJcblwiMC4wXCJcblwiMS4wNFwiXG5cIjEuMjI1XCJcblwiMS4zOTlcIlxuXCIxLjRcIlxuXCIxLjc0XCJcblwiMi4wXCJcblwiMi43MlwiIl0=)
Takes input as string.
[Answer]
## Batch, 102 bytes
```
@set/ps=
@if %s:.=%==%s% (if %s% lss 18 set s=18)else if %s:~0,1%%s:~2,1% lss 14 set s=1.4
@echo %s%
```
First determines whether the input is an integer by checking whether deleting all `.`s has any effect on the string. If it is then the value is readily compared against 18, otherwise the first and third characters are combined into a number which is compared against 14.
[Answer]
# C#, 95 Bytes
Golfed:
```
string y(string p){int a;return int.TryParse(p,out a)?a>17?p:"18":double.Parse(p)<1.4?"1.4":p;}
```
Ungolfed:
```
class YesOfCourseImAnAdult
  {
    public string y(string p)
    {
      int a;
      return int.TryParse(p, out a) ? a > 17 ? p : "18"
       : double.Parse(p) < 1.4 ? "1.4" : p;
    }
  }
```
Test cases:
```
var codeGolf = new YesOfCourseImAnAdult();
Console.WriteLine(codeGolf.y("0"));
Console.WriteLine(codeGolf.y("1"));
Console.WriteLine(codeGolf.y("2"));
Console.WriteLine(codeGolf.y("12"));
Console.WriteLine(codeGolf.y("18"));
Console.WriteLine(codeGolf.y("43"));
Console.WriteLine(codeGolf.y("122"));
Console.WriteLine(codeGolf.y("0.0"));
Console.WriteLine(codeGolf.y("1.04"));
Console.WriteLine(codeGolf.y("1.225"));
Console.WriteLine(codeGolf.y("1.399"));
Console.WriteLine(codeGolf.y("1.4"));
Console.WriteLine(codeGolf.y("1.74"));
Console.WriteLine(codeGolf.y("2.0"));
Console.WriteLine(codeGolf.y("2.72"));
```
Output:
```
18
18
18
18
18
43
122
1.4
1.4
1.4
1.4
1.4
1.74
2.0
2.72
```
]